I have inherited an old project (.NET web site with a .publishproj
file!) that has project dependencies on other .NET class libraries. Everything is .NET 4.8. I am trying to run Add-BindingRedirect
from the Package Manager Console, which was working up until recently, and am now getting the following error:
Add-BindingRedirect : Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401) At line:1 char:20
- Get-Project -all | Add-BindingRedirect
- CategoryInfo : NotSpecified: (:) [Add-BindingRedirect], FileLoadException
- FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.AddBindingRedirectCommand
The .NET web site project has a web.config file with binding redirects that are causing me heartache, and the .NET libraries have app.config files. I need all these projects to share the same binaries.
I can't even run this command on ONE project without getting this error, let alone all the projects at once.
I have tried recycling all my application pools in IIS, restarting with IIS Express, deleting all the .suo
files in the various projects, restarting VS, restarting my machine. I haven't seen anything relating to this error in this context.