For the last couple of days, I’ve been dealing with a web hosting service “mistake”. they decided to limit the usage of trust level attribute, at the web.config file.
so suddenly, the code couldn’ t decrypt the connection string and a nice exception flashed into my eyes:
“System.Security.SecurityException : Request Failed”
at the web.config i used <trust level=”Full” originUrl=”/”> to grant full access to the code, and for opening the configuration:
Configuration cfg = WebConfigurationManager.OpenWebConfiguration(“/”);
ConnectionStringsSectionsection = cfg.ConnectionStrings;
the Exception popped from the first line. so how you get your configuration from a lower trust level ?!
instead using OpenWebConfiguration and getting the ConnectionStrings property, you can write the following line:
ConnectionStringsSection section = (ConnectionStringsSection)WebConfigurationManager.GetSection(“connectionStrings”);
finally, i works great under Medium trust level!!
Isaac.
Hello Isaac,
I am new to MVC and Entity Frameworks.
How do I manage users and accounts in ASP.NET, MVC Framework?
Is there a build in functionallity on MVC?
Thanks
Hi eldan,
i wrote a short post on user management:
http://www.isaacdevelops.com/2009/12/managing-users-in-asp-net-mvc/
hope it helps!