Loading this assembly would produce a different grant set from other instances

I was trying to get to the root of an issue for a client’s environment that was mysteriously down (SharePoint 2013, March 2017 CU). IIS was up and running, disk space was fine, SQL was also fine, but the sites were just loading blank pages. I checked the error logs, on both the application servers, as well as the web front ends, and they all had this same error message. "An exception occurred when trying to issue security token: Loading this assembly would produce a different grant set from other instances". This is a new one on me, I’ve not seen this error before. (Surprise, it’s SharePoint!)

Image

After a bit of searching, I found this article on TechNet, which advised in setting the trust level to full for the web.config files, clearing out ASP.NET temporary files, and a few other things. None of these solutions worked. However, in the comments of the same article, someone had noted to setting the following registry setting, adding a DWORD (32-bit) value of 1 under a new key named LoaderOptimization in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework. And also doing the same under HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework.

Rebooted the servers, although I am sure an IIS reset, and a manual restart of all of the services would have done the trick, but the Farm was down, so a reboot wasn’t an issue to perform.

I found more information on the issue from CA, on this page, under the heading "Defect DE46408 (Formerly 369408) – Application Errors When Instrumenting SharePoint", it states:

"This situation usually happens when the SharePoint site web.config is set to use the legacy CAS model. The legacy CAS model was introduced in .NET version 4, and provokes the error. Refer to https://msdn.microsoft.com/en-us/library/vstudio/dd984947(v=vs.100).aspx for a reference of CAS changes in ASP.NET 4."

I am not exactly sure what prompted this issue, except that there were some recent security updates applied, but this did the trick. I’ll have to dig into this deeper as time permits and see if I can determine the root cause.

About Geoff Varosky
Geoff Varosky is a Senior Architect for Insight, based out of Watertown, MA. He has been architecting and developing web based applications his entire career, and has been working with SharePoint for the past 15 years. Geoff is an active member of the SharePoint community, Co-Founder and Co-Organizer of the Boston Area SharePoint Users Group, co-founder for the Boston Office 365 Users Group, co-organizer for SharePoint Saturday Boston and speaks regularly at SharePoint events and user groups.

One Response to Loading this assembly would produce a different grant set from other instances

  1. Pingback: SharePoint February 2018 Cumulative Updates; Things to Know Before Implementing a SharePoint Intranet; Important Changes in Office 365

Leave a comment