Visual studio outputs this message during build. when updating nuget packages, in a log message more or less like this: Resolution: Create a new registry DWORD value called LoaderOptimization and give it the value 1 within the key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework”. see also: https://stackoverflow.com/questions/42240956/loading-this-assembly-would-produce-a-different-grant-set-from-other-instances see also: https://learn.microsoft.com/en-us/archive/msdn-technet-forums/5db05238-3c12-4e7e-af95-ca56545f0721 see also: https://blog.bugrapostaci.com/2017/02/08/loading-this-assembly-would-produce-a-different-grant-set-from-other-instances-exception-from-hresult-0x80131401/