-1

My program has been compiled with an assembly specific version which can be found in references using ilspy as

 Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35

I cannot find this version of assembly. I lost the file. Instead i have version with

PublicKeyToken=null.

I found that assembly can be manualy installed into GAC naming the directory with pulbic key.

But it is impractical to use.

I came across sn.exe -Vr switch which is supposed to turn off version verification.

Does it work that way? Have anyone tried this?

stepandohnal
  • 457
  • 4
  • 13
  • Is your program is developed in .net. Then ther must be a AssemblyInfo.cs file. There you can see the Assembly version. – csLijo Aug 22 '13 at 11:11
  • That is OK. I simply lost the original DLL and have some without PK token. But the system wants that with correct PK token which i dont have. – stepandohnal Aug 22 '13 at 13:56

2 Answers2

0

The GAC needs the assemblies to be signed and therefore have a public key. Even if it works, it doesn't sound like a good idea to try to hack around it. Can't you just sign it with the key that is used previously? Or recompile your program?

Lars Truijens
  • 42,837
  • 6
  • 126
  • 143
0

If it is not an overly complicated system, I would disassemble the exe that needs the signed/gac'd dll you don't have and fix the reference in the IL to not be the one you have. The reassemble the IL into the exe.

Mike Stall's blog is pretty good at explaining most of it: Debugabbility with Roundtripping Assemblies

Jason Haley
  • 3,770
  • 18
  • 22