Cannot open a website: Exception: System.Security.SecurityException

Refers to:

  • Plesk 12.5 for Windows

Created:

2016-11-16 13:24:06 UTC

Modified:

2017-02-20 06:42:47 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Cannot open a website: Exception: System.Security.SecurityException

Symptoms

Cannot open an ASP.NET website, the following can be found in Event Viewer > Windows Logs > Application :

An unhandled exception occurred and the process was terminated.

Application ID:

Process ID: 6160

Exception: System.Security.SecurityException

Message: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

StackTrace: at System.Web.Hosting.HostingEnvironment.RegisterObject(IRegisteredObject obj)
at Microsoft.AspNet.FriendlyUrls.Abstractions.HostingEnvironmentWrapper.RegisterObject(IRegisteredObject obj)
at Microsoft.AspNet.FriendlyUrls.Caching.StaticFileCacheRunner.GetAllFilenamesInApplication()
at Microsoft.AspNet.FriendlyUrls.Caching.StaticFileCache.<>c__DisplayClass2.<.ctor>b__0(Object _)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

Cause

Trust level is not defined in web.config of the website.

Resolution

Try to add trust level into C:\\Inetpub\\vhosts\\domain.tld\\httpdocs\\web.config , it should look like the following:

<system.web>
<customErrors mode="Off"/>
<trust level="Full" />
</system.web>

Replace domain.tld with domain in question.

Please note that configuration of the websites is Out of Plesk Technical Support scope and this task should be performed by system administrator and website developer.

Have more questions? Submit a request
Please sign in to leave a comment.