0

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?

Madhur Ahuja
  • 22,211
  • 14
  • 71
  • 124
Ignacio Soler Garcia
  • 21,122
  • 31
  • 128
  • 207

1 Answers1

2

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.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
  • Right. The assembly was signed and installed at GAC after compiling the code that referenced it (trying to fix the problem). I think that as the caller knew that it wasn't signed it didn't searched at the GAC. Thanks again Hans. – Ignacio Soler Garcia Feb 07 '11 at 12:07