Assembly generation failed — Referenced assembly 'Interop.Office' does not have a strong name

后端 未结 3 884
一向
一向 2021-01-05 07:48

I have a WPF 4 project to interact with word documents made in VS2010 and a win form User Control project to host word application into it. And other com dlls. All com dlls

3条回答
  •  执念已碎
    2021-01-05 08:32

    I spent a while trawling the internet for this, I believe that the answer you need may be here, for most 3rd party dll's.

    "Adding Strong Name to Interop DLL"

    The article describes three ways to add a strong name to a third party assembly. The commands are:
    1. Adding a Strong Name via Key Pair

    > SN -k MyKeyPair.snk
    > ILDASM ASQLService.dll /out:ASQLService.il
    > ILASM ASQLService.il /dll /resource=ASQLService.res /key=MyKeyPair.snk
    

    2. Adding a Strong Name via a Certificate in a Certificate Store

    > ILDASM ASQLService.dll /out:ASQLService.il  
    > MAKECERT -ss MyCertificateStore -sk MyKeyContainer
    > ILASM ASQLService.il /dll /resource=ASQLService.res /key=@MyKeyContainer
    

    3. Adding a Strong Name via a Certificate in a Personal Information Exchange (.pfx) File

    > MAKECERT -r -pe -sv MyCertificate.pvk MyCertificate.cer
    > PVK2PFX -pvk MyCertificate.pvk -pi qwerty -spc MyCertificate.cer -pfx MyCertificate.pfx
    > SN -p MyCertificate.pfx MyCertificate-publickey.snk
    > ILASM ASQLService.il /dll /resource=ASQLService.res /key=MyCertificate-publickey.snk
    > SN -R ASQLService.dll MyCertificate.pfx
    

    Hope it helped

提交回复
热议问题