0
votes

i'm using routing in asp.net ,in local host every thing good , but after deployment , when browsing menu get below exception

Security Exception

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.Security.Permissions.
SecurityPermission,           mscorlib, Version=4.0.0.0, Culture=neutral,     
PublicKeyToken=b77a5c561934e089' failed.

Source Error: 

An unhandled exception was generated during the execution of the
current web request.          Information regarding the origin and 
location of the            exception can be 
identified using the exception stack trace below.

Stack Trace: 


  [SecurityException: Request for the permission of type     'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral,    PublicKeyToken=b77a5c561934e089' failed.]

System.Web.Security.UrlAuthorizationModule.CheckUrlAccessForPrincipal(String virtualPath, IPrincipal user, String verb) +42 Microsoft.AspNet.FriendlyUrls.Abstractions.UrlAuthorizationModuleWrapper.CheckUrlAccessForPrincipal(String virtualPath, IPrincipal user, String verb) +14 Microsoft.AspNet.FriendlyUrls.FriendlyUrlRoute.GetWebObjectFactory(HttpContextBase httpContext, String modifiedVirtualPath) +159 Microsoft.AspNet.FriendlyUrls.FriendlyUrlRoute.Resolve(HttpContextBase httpContext, IList1 extensions, String virtualPathOverride, IFriendlyUrlRouteSupportFunctions supportFunctions) +220 Microsoft.AspNet.FriendlyUrls.FriendlyUrlRoute.Microsoft.AspNet.FriendlyUrls.Abstractions.IFriendlyUrlRouteSupportFunctions.Resolve(HttpContextBase httpContext, IList1 extensions, String virtualPathOverride) +16 Microsoft.AspNet.FriendlyUrls.FriendlyUrlRoute.GetRouteData(HttpContextBase httpContext, String pathOverride, IFriendlyUrlRouteSupportFunctions supportFunctions) +140 Microsoft.AspNet.FriendlyUrls.FriendlyUrlRoute.GetRouteData(HttpContextBase httpContext) +8 System.Web.Routing.RouteCollection.GetRouteData(HttpContextBase httpContext) +233 System.Web.Routing.UrlRoutingModule.PostResolveRequestCache(HttpContextBase context) +60 System.Web.Routing.UrlRoutingModule.OnApplicationPostResolveRequestCache(Object sender, EventArgs e) +82 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69

any advice

1

1 Answers

1
votes

This indicates, that your application is not running with Full trust on your IIS, or the trust level is not high enough.

Please follow the following checklist:

  1. Open up IIS
  2. Click on your website on the left panel
  3. Double click on .NET Trust Level in the right panels.
  4. Set the Trust Level to Full (internal)