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
Try enabling 'Full' trust for your application. This Knowledge Base article will show you how to modify your web.config to enable 'Full' trust.
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?
The default server setting for the trust level is actually "Medium". That's why you need to change it.