none
Execution Permissions cannot be required error when opening SharePoint Central Administration

    Question

  • The following is the stack trace can anyone share what might be causing and how to resolve this.

    Execution permission cannot be acquired.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Security.Policy.PolicyException: Execution permission cannot be acquired.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

    Stack Trace:


    [PolicyException: Execution permission cannot be acquired.]
       System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Boolean checkExecutionPermission) +10246216
       System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Int32& securitySpecialFlags, Boolean checkExecutionPermission) +97

    [FileLoadException: Could not load file or assembly 'Ajax, Version=5.7.20.2, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant permission to execute. (Exception from HRESULT: 0x80131418)]
       System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
       System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +416
       System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +166
       System.Reflection.Assembly.Load(String assemblyString) +35
       System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +190

    [ConfigurationErrorsException: Could not load file or assembly 'Ajax, Version=5.7.20.2, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant permission to execute. (Exception from HRESULT: 0x80131418)]
       System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +11326376
       System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +388
       System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +232
       System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +48
       System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +210
       System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath configPath, Boolean supportLocalization, String outputAssemblyName) +76
       System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed) +11315554
       System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories) +185
       System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +551

    [HttpException (0x80004005): Could not load file or assembly 'Ajax, Version=5.7.20.2, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant permission to execute. (Exception from HRESULT: 0x80131418)]
       System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +76
       System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +1012
       System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +1025

    [HttpException (0x80004005): Could not load file or assembly 'Ajax, Version=5.7.20.2, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant permission to execute. (Exception from HRESULT: 0x80131418)]
       System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11420374
       System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88
       System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4405156


     
    Monday, March 30, 2015 12:13 PM

Answers

  • HI Eric,

    I have managed to solve this by making the following web config changes to:
    <system.web>
    <trust level="Full" originUrl="" />
    </system.web>

    Trust level was set to <trust level="WSS_Custom" originUrl="" />

    Thank you so much for your help

    • Marked as answer by Karabo Calvin Tuesday, March 31, 2015 12:45 PM
    Tuesday, March 31, 2015 12:45 PM

All replies

  • Hi karabo,

    According to your error message, it says that the ajax.dll (Version=5.7.20.2) assembly is missing.

    As far as I know, SharePoint Central Administration web application does not refer to the ajax.dll assembly by OOB. 

    Do you have any custom solution which reference ajax.dll assembly? If so, please undeploy it before your solution is working fine.

    Also you can try to copy the ajax.dll assembly to Global Assembly Cache or your Central Administration web application Bin directory.

    Reference:

    http://www.herdprotect.com/ajax.dll-fc852aef74018cc802cbcb9b6dbc470799af2885.aspx

    https://msdn.microsoft.com/en-us/library/office/ms521365%28v=office.12%29.aspx

    Best Regards,

    Eric


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Tuesday, March 31, 2015 8:38 AM
  • Hi Eric,

    I have manually added the Ajax.dll file to the bin of the Central Administration directory but still getting the same error.

    Yes i do have custom solutions that reference the Ajax.dll  but because this is a live/production server  i cant really undeploy at the moment  as they might be system failures to users.

    Even after running the SharePoint config wizard this error still persist.

    Anything else i can try?

    Regards,
    Karabo

    Tuesday, March 31, 2015 12:15 PM
  • HI Eric,

    I have managed to solve this by making the following web config changes to:
    <system.web>
    <trust level="Full" originUrl="" />
    </system.web>

    Trust level was set to <trust level="WSS_Custom" originUrl="" />

    Thank you so much for your help

    • Marked as answer by Karabo Calvin Tuesday, March 31, 2015 12:45 PM
    Tuesday, March 31, 2015 12:45 PM
  • Hi Karabo,

    Glad to hear your issue solved and thanks for your sharing!

    Best Regards,

    Eric


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Wednesday, April 1, 2015 1:01 AM
  • The error is that there is an assembly is trying to load which has an assembly level RequestMinimum security set specified. The CLR security policy was not going to grant that assembly what it had asked for in it's minimum grant set, so the assembly was not loaded and that exception was thrown.

    You'll need to find which assembly is failing to load, It might be an orphan dll when you retract a farm solution or third party solution in your farm, then delete it (or move it over to another location for backup)

    In this case, I think there is a dll that related to Ajax is stored in BIN folder of Admin Central virtual directory, such as C:\inetpub\wwwroot\wss\VirtualDirectories\25108\bin. You could take a look on this location and delete it.

    regards,

    Kong

    Tuesday, December 29, 2015 5:09 PM