0

I am having problems with required trust level with my web host using an ASP.NET MVC application created in VS 2015.

So I created a "dummy" application from the template (none of my own code - just the Home, About, Contact controller etc that are created by default) and web host is running in Medium trust level. I replicated it locally forcing it to medium trust level in web.config and get the following exception trace:

System.Security.CodeAccessSecurityEngine.ThrowSecurityException(RuntimeAssembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandleInternal rmh, SecurityAction action, Object demand, IPermission permThatFailed) +165
System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Object assemblyOrString, PermissionSet granted, PermissionSet refused, RuntimeMethodHandleInternal rmh, SecurityAction action, Object demand, IPermission permThatFailed) +100
System.Security.CodeAccessSecurityEngine.CheckSetHelper(PermissionSet grants, PermissionSet refused, PermissionSet demands, RuntimeMethodHandleInternal rmh, Object assemblyOrString, SecurityAction action, Boolean throwException) +284
System.Security.CodeAccessSecurityEngine.CheckSetHelper(CompressedStack cs, PermissionSet grants, PermissionSet refused, PermissionSet demands, RuntimeMethodHandleInternal rmh, RuntimeAssembly asm, SecurityAction action) +70
System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) +0
System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) +70 System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +40
System.Type.GetType(String typeName) +30
System.CodeDom.Compiler.CompilerInfo.get_IsCodeDomProviderTypeValid() +10 System.Web.Compilation.CompilationUtil.GetRecompilationHash(CompilationSection ps) +2485
System.Web.Configuration.CompilationSection.get_RecompilationHash() +92 System.Web.Compilation.BuildManager.CheckTopLevelFilesUpToDateInternal(Int64 cachedHash) +498
System.Web.Compilation.BuildManager.CheckTopLevelFilesUpToDate(Int64 cachedHash) +53
System.Web.Compilation.BuildManager.ExecutePreAppStart() +133
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +674

Is it possible for me to run in Medium trust level for a MVC application, what about it is the message complaining about?

Web host said it can be increased to Full trust if needed, but I want to make sure it is actually required before requesting that.

Functionality will eventually be: get page contents (like blog posts) from a database and show .cshtml pages.

1 Answers1

0

If you app includes a reference to the entity framework you will need full trust

https://www.godaddy.com/help/do-your-hosting-accounts-support-mvc4-and-mcv5-applications-8999

Edit looks like Asp.Net requires full trust

asp.net mvc 5 entity framework 6 identity working with trust level = medium?

Community
  • 1
  • 1
Ken Tucker
  • 4,126
  • 1
  • 18
  • 24
  • Thanks, I don't have a reference to EF, is there a reference anywhere for which references require which trust level? – user5719373 Dec 27 '15 at 16:52