加载此程序集将从其他实例生成不同的授权集.(HRESULT异常:0x80131401)

Baa*_*ali 18 sharepoint sharepoint-2013 windows-server-2012-r2

我们使用Windows更新修补了SharePoint 2013服务器,从那时起我们收到以下错误.我们已重新启动服务器,手动删除了Windows更新,然后重新启动服务器,在Windows更新之前恢复到Windows服务器的副本,但错误仍然存​​在.我们还从Windows目录中删除了临时文件,没有任何帮助.

我附上了一夜之间应用于我们服务器的Windows更新截图在此输入图像描述

 Loading this assembly would produce a different grant set from other     instances. (Exception from HRESULT: 0x80131401) 
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.IO.FileLoadException: Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)

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: 


[FileLoadException: Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)]
System.Linq.Enumerable.Any(IEnumerable`1 source) +0
       System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromAssemblyCollection(IEnumerable`1 assemblies, Boolean buildingFromCache) +210
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +98
System.Web.Compilation.BuildManager.ExecutePreAppStart() +139
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +1005

[HttpException (0x80004005): Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +646
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +779


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET    Version:4.0.30319.36366 
Run Code Online (Sandbox Code Playgroud)

tec*_*414 37

在Sitecore上开发时遇到了同样的异常,并解决了iisreset这个问题.

  • 我们只是回收了应用程序池,问题已解决。甚至不使用sharepoint,只是一个无聊的asp.net应用程序。 (3认同)
  • iisreset 对我有用。有谁知道什么会导致这个问题? (3认同)

Mar*_*lug 5

解决方案似乎是:

创建一个名为 LoaderOptimization 的新注册表 DWORD 值,并在“HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework”项中为其指定值 1。

进一步阅读:

http://blog.bugrapostaci.com/2017/02/08/loading-this-assembly-would-produce-a-different-grant-set-from-other-instances-exception-from-hresult-0x80131401/

https://social.technet.microsoft.com/Forums/en-US/5db05238-3c12-4e7e-af95-ca56545f0721/loading-this-assembly-would-produce-a-different-grant-set-from-other-实例?论坛=sharepointgeneral

  • 我没有用这个。我只是复活了一个被一些过分热心的 stackoverflow 版主掩埋的答案(在某个代表级别,您可以看到已删除的答案)。我将删除的答案转发给了我组织中遇到问题的某个人。 (4认同)
  • 仅供参考,链接的文章实际上说*不*这样做。 (2认同)