Security Exception in UOL Host

2

I developed an ASP.NET MVC application that runs perfectly on the spot.

When I upload it to UOL Host, when I access the page (www.manuelaibi.com.br) I get the error Security Exception ...

It's important to note that I have already changed the Web.config to have the lines

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

in the system web key.

All the research I did did not find any other reason not to work.

Would anyone have any ideas, please?

Just to complete the information set the error stack is:

[SecurityException: Request failed.]    System.Security.CodeAccessSecurityEngine.ThrowSecurityException (RuntimeAssembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandleInternal rmh, SecurityAction action, Object demand, IPermission permThatFailed) +96    System.Security.CodeAccessSecurityEngine.ThrowSecurityException (Object assemblyOrString, PermissionSet granted, PermissionSet refused, RuntimeMethodHandleInternal rmh, SecurityAction action, Object demand, IPermission permThatFailed) +80    System.Security.CodeAccessSecurityEngine.CheckSetHelper (PermissionSet grants, PermissionSet refused, PermissionSet demands, RuntimeMethodHandleInternal rmh, Object assemblyOrString, SecurityAction action, Boolean throwException) +288    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) +2045    System.Web.Configuration.CompilationSection.get_RecompilationHash () +107    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 14.09.2018 / 14:50

2 answers

0

Hello, following the documentation you should add the security policies correctly. Add this line to your web.config file: Below is the documentation for levels of possible security > Follow documentation of breaking changes , for this version of .NET.

<system.Web>
...
    <trust level="Full"/>
...
</system.Web>
    
14.09.2018 / 16:34
0

When you use the trustLevel attribute name="Full" you create conflict with the lines of the system.codedom key and these should be commented out of the Web.config

    
14.09.2018 / 20:10