Error when uploading site Asp.net MVC

0

I uploaded my files to my site hosting but I'm getting these errors, do I have to add some permission in Web.config?

  

[SecurityException: Request failed.]      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 () +12      System.Web.Compilation.CompilationUtil.GetRecompilationHash (CompilationSection ps) +2175      System.Web.Configuration.CompilationSection.get_RecompilationHash () +96      System.Web.Compilation.BuildManager.CheckTopLevelFilesUpToDateInternal (Int64 cachedHash) +458      System.Web.Compilation.BuildManager.CheckTopLevelFilesUpToDate (Int64 cachedHash) +51      System.Web.Compilation.BuildManager.ExecutePreAppStart () +135      System.Web.Hosting.HostingEnvironment.Initialize (ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +531

    
asked by anonymous 16.09.2016 / 23:14

1 answer

0

Some time ago I went through this same problem, initially try to add the Full security level in your application through Web.config:

   
<securityPolicy>
    <trustLevel name="Full" />
  </securityPolicy>

If it still does not work, try removing the Nuget Microsoft.CodeDom.Providers.DotNetCompilerPlatform and Microsoft.Net.Compilers packages.

Compile and republish your application.

    
21.09.2016 / 18:36