title: Trust level for components of the Default ASP.NET MVC project in VS 2015?
body: <p>I am having problems with required trust level with my web host using an ASP.NET MVC application created in VS 2015.</p>
  
  <p>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:</p>
  
  <blockquote>
    <p>System.Security.CodeAccessSecurityEngine.ThrowSecurityException(RuntimeAssembly
    asm, PermissionSet granted, PermissionSet refused,
    RuntimeMethodHandleInternal rmh, SecurityAction action, Object demand,
    IPermission permThatFailed) +165<br>
    System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Object
    assemblyOrString, PermissionSet granted, PermissionSet refused,
    RuntimeMethodHandleInternal rmh, SecurityAction action, Object demand,
    IPermission permThatFailed) +100<br>
    System.Security.CodeAccessSecurityEngine.CheckSetHelper(PermissionSet
    grants, PermissionSet refused, PermissionSet demands,
    RuntimeMethodHandleInternal rmh, Object assemblyOrString,
    SecurityAction action, Boolean throwException) +284<br>
    System.Security.CodeAccessSecurityEngine.CheckSetHelper(CompressedStack
    cs, PermissionSet grants, PermissionSet refused, PermissionSet
    demands, RuntimeMethodHandleInternal rmh, RuntimeAssembly asm,
    SecurityAction action) +70<br>
    System.RuntimeTypeHandle.GetTypeByName(String name, Boolean
    throwOnError, Boolean ignoreCase, Boolean reflectionOnly,
    StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean
    loadTypeFromPartialName, ObjectHandleOnStack type) +0<br>
    System.RuntimeTypeHandle.GetTypeByName(String name, Boolean
    throwOnError, Boolean ignoreCase, Boolean reflectionOnly,
    StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean
    loadTypeFromPartialName) +70    System.RuntimeType.GetType(String
    typeName, Boolean throwOnError, Boolean ignoreCase, Boolean
    reflectionOnly, StackCrawlMark&amp; stackMark) +40<br>
    System.Type.GetType(String typeName) +30<br>
    System.CodeDom.Compiler.CompilerInfo.get_IsCodeDomProviderTypeValid()
    +10    System.Web.Compilation.CompilationUtil.GetRecompilationHash(CompilationSection
    ps) +2485<br>
    System.Web.Configuration.CompilationSection.get_RecompilationHash()
    +92    System.Web.Compilation.BuildManager.CheckTopLevelFilesUpToDateInternal(Int64
    cachedHash) +498<br>
    System.Web.Compilation.BuildManager.CheckTopLevelFilesUpToDate(Int64
    cachedHash) +53<br>
    System.Web.Compilation.BuildManager.ExecutePreAppStart() +133<br>
    System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager
    appManager, IApplicationHost appHost, IConfigMapPathFactory
    configMapPathFactory, HostingEnvironmentParameters hostingParameters,
    PolicyLevel policyLevel, Exception appDomainCreationException) +674</p>
  </blockquote>
  
  <p>Is it possible for me to run in Medium trust level for a MVC application, what about it is the message complaining about?</p>
  
  <p>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.</p>
  
  <p>Functionality will eventually be: get page contents (like blog posts) from a database and show .cshtml pages.</p>