Why the assembly loader is not checkin the GAC for a C++/CLI mixed mode assembly?

675 views Asked by At

I have a C# project that references a C++/CLI mixed mode assembly. That assembly is stored inside a folder into the PATH and it is also present at the GAC but when it is executed I get a:

System.IO.FileNotFoundException: Could not load file or assembly 'PcsSocketCommunications500, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'

The version 0.0.0.0 is because the C++/CLI does not has an Assembly version class but as far as I know this shouldn't be a problem.

Running process monitor I've seen that the system just looks for the assembly at the same folder as the main process ... I'm not an expert of assembly loading but I expected to see at least some GAC searchs and 'maybe' some PATH searchs .. That's what I got (PcsSocketCommunication500.dll is the C++/CLI assembly and in black it's the working directory):

enter image description here

Any idea about why the loader is not checking the GAC or the PATH?

1

There are 1 answers

1
Hans Passant On BEST ANSWER

PublicKeyToken=null

The assembly isn't strong named. That means it can't be located in the GAC, the CLR isn't going to look there. Not sure what you did to get in the GAC, but it shouldn't be possible as-is.