1

I have a class library which is installed in GAC and it has couple of dependencies. When the dependencies are all placed in GAC as well, it works as expected. However, when any of the dependencies is outside of GAC, it throws file not found exception. I checked csproj assembly references and even gave absolute path for the assemblies outside of GAC but still had the same exception. My first guess was it might have been security requirement of GAC assemblies and tried signing all the assemblies but I was still unable to make it work. Do you have any idea what I am missing here?

Le Chat Noir
  • 45
  • 1
  • 7
  • Are you sure you're using .NET and not .NET Core? You can't manipulate assembly loading behaviour (e.g. binding redirects, resolve events etc.) once any version of the same assembly is in GAC. This tends to completely destroy .NET Core applications :) – Luaan Nov 04 '20 at 12:59
  • I think the real question is why you're installing your class library in the GAC in 2020. But yes, a GAC'ed assembly's dependencies need to be in the GAC as well, at least, if you don't deploy the references with the calling application. – CodeCaster Nov 04 '20 at 13:00
  • Where exactly are you putting your libraries? You can use the [Fusion Log Viewer](https://learn.microsoft.com/en-us/dotnet/framework/tools/fuslogvw-exe-assembly-binding-log-viewer) to verify where your program looks for the libraries. – devsmn Nov 04 '20 at 13:01

0 Answers0