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

前端 未结 4 1153
无人及你
无人及你 2020-12-17 01:14

One of our partners provided us with an assembly we need to access from our application. Unfortunately, this is not strong-name so we can\'t install it to the GAC. And we ca

4条回答
  •  天涯浪人
    2020-12-17 01:37

    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
    

提交回复
热议问题