1

I am trying to write a 'hello world' application with a dependency to an assembly of a CAD software (SpaceClaim). I add the assembly SpaceClaim.Api.V12.dll to my references and build without problems. When I try to run the application I get the following error:

Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'SpaceClaim.Api.V12, Version=12.1.11373.0, Culture=neutral, PublicKeyToken=7210645d4d5e3a39' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) File name: 'SpaceClaim.Api.V12, Version=12.1.11373.0, Culture=neutral, PublicKeyToken=7210645d4d5e3a39' ---> System.IO.FileLoadException: Could not load file or assembly 'SpaceClaim.Api.V12, Version=12.1.8703.0, Culture=neutral, PublicKeyToken=7210645d4d5e3a39' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) File name: 'SpaceClaim.Api.V12, Version=12.1.8703.0, Culture=neutral, PublicKeyToken=7210645d4d5e3a39'

(this error message is also discussed here)

After checking the GAC, I can see that there is an assembly with same strong name with the one I am referencing (Version=12.1.8703.0). However when I open these two with a disassembler (ILSpy), I see that they target different runtimes, the one I am referencing targets .NET 2.0 and the one in the GAC .NET 4.0.

I would like to ignore the one in the GAC and pick from the local directory the one that targets NET 2.0. Apparently, simply copying it into the same folder with the executable is not enough. From what I 've read so far here and here, in order to do this, one needs to 'remove the signing' from the assembly. I don't have much experience with .NET so I am wondering, is this something that I can do with 3rd party assembly and if yes how? Or what other alternatives I have? The two assemblies have the same strong name so putting them both in the GAC is not an option as far as I understand.

Thank you

Community
  • 1
  • 1
opetroch
  • 2,878
  • 2
  • 18
  • 21

0 Answers0