Why am I getting this error: System.Security.SecurityException: permission request like "System.Web.AspNetHostingPermission, ..." failed

I am trying to run my site locally. I get this error:

Description: The application attempted to perform an operation not permitted by the security policy. To grant this application the required permissions, contact your system administrator or change the application trust level in the configuration file.

Exception Details: System.Security.SecurityException: A permission request 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 do not encounter UNC sharing or access to any network shares. This is a .NET 3.5 site running on IIS7 in a Windows 7 window.

I donโ€™t think I made any changes before it started, and since it was I who rebuilt the solution and restarted the computer.

+3
source share
1 answer

Give it a try. This is due to setting up the application pool, "Download user profile = true."

+7
source

Source: https://habr.com/ru/post/1395368/


All Articles