Added TypeScript code and application broke.

Discussion in 'General troubleshooting' started by Bernd, Nov 7, 2013.

  1. I get this message since adding TypeScript files to an ASP.net 4.0 Master Page Application.

    I remove the two TypeScript files from the project and the app still returns this error.

    [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, IList`1 extensions, String virtualPathOverride, IFriendlyUrlRouteSupportFunctions supportFunctions) +220
    Microsoft.AspNet.FriendlyUrls.FriendlyUrlRoute.Microsoft.AspNet.FriendlyUrls.Abstractions.IFriendlyUrlRouteSupportFunctions.Resolve(HttpContextBase httpContext, IList`1 extensions, String virtualPathOverride) +16
    Microsoft.AspNet.FriendlyUrls.FriendlyUrlRoute.GetRouteData(HttpContextBase httpContext, String pathOverride, IFriendlyUrlRouteSupportFunctions supportFunctions) +140
    Microsoft.AspNet.FriendlyUrls.FriendlyUrlRoute.GetRouteData(HttpContextBase httpContext, String pathOverride) +9
    Microsoft.AspNet.FriendlyUrls.FriendlyUrlsModule.RedirectToFriendlyUrl(HttpContextBase httpContext, IFriendlyUrlRoute route, IVirtualPathUtility virtualPathUtility) +346
    Microsoft.AspNet.FriendlyUrls.FriendlyUrlsModule.<Init>b__0(Object sender, EventArgs e) +171
    System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69
     
  2. Elshadriel

    Elshadriel Winhost Staff

    Try enabling 'Full' trust for your application. This Knowledge Base article will show you how to modify your web.config to enable 'Full' trust.
     
    Last edited by a moderator: Oct 14, 2015
    Michael likes this.
  3. I added it the config file and it worked. It didn't have anything to do with TypeScript after all.

    Why did it require changing the file, when the server indicated it was set to full trust?
     
    Michael likes this.
  4. Elshadriel

    Elshadriel Winhost Staff

    The default server setting for the trust level is actually "Medium". That's why you need to change it.
     
    Michael likes this.

Share This Page