Windows error 0x80131401, -2146233343

Detailed Error Information

SECURITY_E_INCOMPATIBLE_SHARE[1]

Message"Loading this assembly would produce a different grant set from other instances."
Comment Loading this assembly would produce a different grant set from other instances

HRESULT analysis[2]

FlagsSeverityFailure
Reserved (R)false
OriginMicrosoft
NTSTATUSfalse
Reserved (X)false
FacilityCode19 (0x013)
NameFACILITY_URT[2][3]
DescriptionThe source of the error code is .NET CLR.[2][3]
Error Code5121 (0x1401)

Questions

21votes
4answers

Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)

We have SharePoint 2013 Servers that were patched with windows updates and since then we are receiving the following error. We have restarted the servers, removed the windows updates manually and then restarted the servers, restored to a copy of windows server before the windows update but the error is [...] read more
sharepoint
sharepoint-2013
windows-server-2012-r2
5votes
3answers

Debugging assembly load issue

I have a very wierd problem happening to me during unit testing (MSTest in Visual Studio - .NET 3.5 SP1): 1. I click "Run All Tests in solution" 2. All tests passes, except for one particular class, where every tests throws the following exception: "System.IO.FileLoadException: Loading this assembly would produce [...] read more
c#
.net
visual-studio
mstest
fileloadexception
4votes
1answer

Restricted Permission AppDomain Grant Set Issue

I have some code that dynamically compiles a Razor templates into an Assembly which I execute with a set of permissions (no access to files, etc). This works on our development computers and on our test server (Windows 2008 IIS7 x64 .NET 4). But on our production server (Same spec) [...] read more
c#
appdomain
3votes
1answer

IL Rewrite fails to load .Net DLL

I have built the IL Rewriter for some custom requirement. All it does is 1. Creates method references for another .Net DLL (newly built custom DLL) 2. Inject epilogue & prologue for few required methods, they internally call above method references. Everything works fine with sample Windows form application. However, [...] read more
c#
asp.net
.net
clr-profiling-api
3votes
2answers

Specflow Code behind file is not generated properly

I am new to Specflow and C#. Currently, I am facing one issue after updating the .net core as 2 and .net framework version as 4.6.2. Specflow - Code behind cs file is not getting generated properly. Instead I am getting the below error in the specflow feature-code behind file. [...] read more
c#
specflow
3votes
1answer

MS Test error when running all tests

I am currently working on a project that is using MS Test for unit testing. When I do a "Run All Tests" I get the following error for about 1/3 of the tests: Test method [Test Method] threw exception System.IO.FileLoadException, but exception System.InvalidOperationException was expected. Exception message: System.IO.FileLoadException: Loading this [...] read more
visual-studio
unit-testing
mstest
2votes
1answer

Loading this assembly would produce a different grant set from other instances exception in start .netframework website ninject constructor

We have a .NETFramework 4.7 website which we published exact same version of that in 2 windows servers server1 is Windows-Server-2016 and Server 1 works fine, however we got an error in server 2 wich is Windows-Server-2012: in startup of application: [FileLoadException: Loading this assembly would produce a different grant [...] read more
asp.net
dependency-injection
.net-4.0
ninject
2votes
1answer

GhostDoc VisualStudio extension Load exception

I've formatted my harddrive to reinstall Windows 8 x64. After installing VisualStudio 2013 and then GhostDoc extension, in the moment that I try to run the VS IDE (an VB/C# project of any kind), it throws an exception related to GhostDoc that I would like to solve: enter image description [...] read more
c#
.net
vb.net
visual-studio-2013
ghostdoc
1vote
2answers

Sql Server 2012 SSIS Integration Services Catalog

I am getting the following error when trying to create the IS Catalog in Sql Server 2012 SSIS. > TITLE: SQL Server Integration Services ------------------------------ Operation 'Create' on object 'CatalogFolder[@Name='DeployTest']' failed during execution. (Microsoft.SqlServer.Management.Sdk.Sfc) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=11.0.2100.60+((SQL11_RTM).120210-1917+)&LinkId=20476 ------------------------------ ADDITIONAL INFORMATION: Exception has been thrown by the target of an [...] read more
sql-server
ssis
sql-server-2012
1vote
1answer

System.IO.FileLoadException: Loading this assembly would produce a different grant set from other instances

I'm facing the following error here: System.IO.FileLoadException: Loading this assembly would produce a different grant set from other instances. I am using Umbraco CMS which is build with .net. Whenever I try to install a package on the server it comes with that error followed by this one: Error importing [...] read more
asp.net
.net
azure
iis
umbraco
1vote
1answer

Library version conflicts in .NET: System.Net.Http

I am trying to use NuGet Package Manager Console to deploy changes to the database. When I issue the Update-Database command, it fails with an error message saying: Could not load file or assembly 'System.Net.Http, Version=4.1.1.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. [...] read more
.net
nuget
1vote
0answers

Wix Setup Project breaks unrelated Migrations update-database call

Running update-database from the Package Manager Console on an ASP.NET MVC Web Application fails after I add an unrelated Wix setup project to my solution. Why is update-database accessing this unrelated project? Why does the presence of the wix project trigger a load of an assembly that cannot be found? [...] read more
entity-framework
wix
entity-framework-migrations
1vote
1answer

Error in ReportViewer after deploy ClickOnce - HRESULT: 0x80131401

I hope that will help me with this issue. I have a problem with a application (winforms) build with .net framework 4.5 and ReportViewer 11 (Reporv Viewer 2012). Ago few weeks I deploy using Windows Azure and install to clients, but when i run a report show me an exception. [...] read more
c#
winforms
.net-4.5
clickonce
reportviewer
1vote
1answer

in mvc3 razor i get error Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)

I am working on mvc3 razor application firstly my project was runing correctly but after replacement of system.web.mvc.dll and System.Web.WebPages.Razor files from mvc4 folder to mvc3 folder it will give following error while run it. Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: [...] read more
asp.net-mvc-3-areas
1vote
8answers

Error Compiling Program in Visual Studio 2008

So I have never seen this issue before and don't know where to begin troubleshooting the issue. Cannot register assembly "obj\Debug\MyProject.Vsto.dll". Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401) Where do I start to troubleshoot this? I should mention this is a [...] read more
.net
visual-studio-2008
vsto
visual-studio-2008-sp1
compiler-errors
1vote
1answer

CannotCreateCustomizationDomainException: Customization could not be loaded because the application domain could not be created

I'm trying to run an Excel 2007 VSTO 3.0 addin we've created. However since installing the ION Trading MarketView Excel Plug-in our add-in no longer seems to load properly and fails with the following error: > Microsoft.VisualStudio.Tools.Applications.Runtime.CannotCreateCustomizationDomainException: > Customization could not be loaded because the application domain could not be [...] read more
vsto
excel-2007
1vote
1answer

restart of web dev server every time load ASP.NET MVC application

I continously get this problem (stack trace below) when I start my ASP.NET MVC application and have to restart the web dev server and then it goes away. It appears to be happening on when I make modification in my jquery and then try to restart the application. protected void [...] read more
asp.net
jquery
asp.net-mvc
1vote
2answers

Can't use WPF designer in VS2008 SP1

i searched several hours four solution and nothing found. If I open WPF Designer in my VS2008 Team Suite SP1 I become following error: > Loading this assembly would produce a different grant set from other > instances. (Exception from HRESULT: 0x80131401) at > System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, > Boolean [...] read more
xaml
visual-studio-2008-sp1
0votes
3answers

To prevent possible data loss in windows form c#

If i click to Form1.cs in windows form , i get below exception, > To prevent possible data loss before loading the designer , the following > errors must be resolved: > > Loading this assembly would produce a different grant set from other > instances.(Exception from HRESULT 0x80131401) > [...] read more
c#
exception
0votes
1answer

The type initializer for "Azure.Core.Pipeline.HttpClientTransport" threw an exception.'

I am getting below exception when trying to access the azure key vault. > The type initializer for "Azure.Core.Pipeline.HttpClientTransport" threw an > exception.' FileLoadException: Loading this assembly would produce a different > grant set from other instances. (Exception from HRESULT: 0x80131401) Below is my code: When trying to create the [...] read more
c#
asp.net
azure
azure-web-app-service
azure-keyvault
0votes
0answers

VS2015 C# Localhost ASHX Error (But it works on Server?) HRESULT 0x80131401

I'm building a website in VS2015 (C# using Razor) I see many posts where people say that they receive this error on their server, but not localhost - my issue is the opposite. I'm seeing this error in every *.ashx file preamble in this specific Website only while running Localhost [...] read more
c#
visual-studio-2015
hresult
0votes
1answer

Shared domain for app domain while trying to run microsoft reportviwer in legacy mode

I am aiming to have Microsoft report viewer on .net 4.x with .net 3.5 with NetFx40_LegacySecurityPolicy as noted here With full trust I got Loading this assembly would produce a different grant set from other instances. When try with relevant permissions by signing assemblies: PermissionSet permissions = new PermissionSet(PermissionState.None); permissions.AddPermission(new [...] read more
c#
reportviewer
appdomain
0votes
0answers

CreateInstanceAndUnwrap fails to load assembly in new appdomain

We were facing some issue while loading assembly in new app domain by using createInstanceFromUnWrap method. I added actual code & inner exception message for this issue (PFB). But we suspected this error is not related to assembly loading method.Kindly let me know how to get exception for appdomain create [...] read more
c#
mef
appdomain
0votes
1answer

. net framework 4 breaks Central administration and a few Web Apps- SP 2013

After weeks of everything working fine. Central admin and a few Webapps break down suddenly in SP2013 Was getting error: > System.IO.FileLoadException: Loading this assembly would produce a different > grant set from other instances. (Exception from HRESULT: 0x80131401) I set the trust level="Full" originUrl="" legacyCasModel="false" in web.config for Central [...] read more
cas
.net-framework-version
0votes
2answers

Error when building and debugging project in Visual Studio: Loading this assembly would produce a different grant set from other instances

I am working on my project in Visual Studio 2013, and vb.net. Everything is fine until today. My computer auto updated itself yesterday and I got this error when I try to debug my project today. Error 1 The "ResolveComReference" task could not be instantiated from "Microsoft. Build.Tasks.v12.0, Version=12.0.0.0, Culture=neutral, [...] read more
vb.net
visual-studio-2013
0votes
1answer

VSTO 3.0 outlook addin does not load

I have written a VSTO 3.0 add in for outlook. It is on the usual lines of ThisAddIn. The addin is targeted at office 2007 or above. We discovered recently that it does not work on certain workstations. Here is a summary of where it fails to load. The addin [...] read more
outlook
vsto
add-in
0votes
1answer

WPF designer error when selecting new WPF project

I'm getting the following error when I select a new WPF project. Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401) at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean [...] read more
c#
wpf
-1votes
1answer

Error when creating PDF from ASP.NET report

I'm trying to programmatically create a pdf file from ASP.NET report. When I run the program it throws the following error: > Error occurred during report processing. Loading this assembly would produce a > different grant set from other instances. (Exception from HRESULT: 0x80131401) I already tried adding <trust level="Full"> [...] read more
c#
asp.net
.net
iis

Comments

Leave a comment

(plain text only)

Sources

  1. https://github.com/dotnet/coreclr/blob/v1.1.0/src/inc/corerror.xml
  2. https://msdn.microsoft.com/en-us/library/cc231198.aspx
  3. winerror.h from Windows SDK 10.0.14393.0

User contributions licensed under CC BY-SA 3.0