How to register a non-strong-name assembly to be loaded as if it were in the GAC?

You have a few options at that point.

The first is to place the assembly in a directory that has the name of the assembly (without the extension) which is a subdirectory of the application directory.

The second is to specify the sub directory you want the CLR to probe for references in the app.config file using the probing element.

Finally, you can load the assembly dynamically using the various Load methods on the Assembly class but I would say that's a very bad idea in this case, given that you have the assembly, and you have concrete types that you want to use in it. Late time assembly loading like this is typically used when you want to subsitute the implementation of certain abstractions, which doesn't seem to be the case here.


Workaround using decompilation & signing (using Developer Command prompt for Visual studio):

ildasm.exe /all /typelist /out=DataSystem.il DataSystem.dll
ilasm.exe /dll /optimize /key=DataSystem.snk DataSystem.il

DataSystem.snk can be generated as a file using Visual Studio IDE http://www.bloggedbychris.com/2011/09/29/signing-a-net-assembly-in-visual-studio/

then you should be able to run

gacutil.exe -i DataSystem.dll

Tags:

.Net

Gac

Fusion