views:

202

answers:

2

Whe I try to run my site locally I get this error:

Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Stacktrace:

[SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Reflection.Assembly._GetType(String name, Boolean throwOnError, Boolean ignoreCase) +0
System.Web.UI.Util.GetTypeFromAssemblies(ICollection assemblies, String typeName, Boolean ignoreCase) +201
System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +302
System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +64

I'm not running across a UNC share or accessing any shared network resources. It's a .NET 3.5 site running on IIS7 on a windows 7 box.

I don't think I made any changes before this started happening, and since it has I've rebuilt the solution & restarted the computer.

+3  A: 

Try the following. It has to do with Application Pool setting, "Load User Profile=True".

AboutDev
Bingo, that did it. No idea how that got changed, it was working earlier today. Thanks!
Glenn Slaven
Glad to help. Happy coding!
AboutDev
A: 

oh sweet JESUS thank you for posting this! I don't know WHY or HOW this ever got changed (I sure as hell didn't do it!) but setting it to true FIXED EVERYTHING!

thank you very much!

Josh