Is there an easy way to sign a C++ CLI assembly in VS 2010?

前端 未结 6 1717
囚心锁ツ
囚心锁ツ 2020-12-30 00:18

Right now I am setting the Linker/Advanced/KeyFile option.

I am getting the \"mt.exe : general warning 810100b3: is a strong-name signed assembly and embedding

6条回答
  •  暖寄归人
    2020-12-30 00:56

    I ran into this problem with VS2010 SP1 for the WIN32 platform. Looking at the build .log file I found that the /KEYFILE parameter was given to the initial link for the .DLL, but after the manifest was created and the second link was done to include the manifest the /KEYFILE parameter was missing. After looking around a bit I found that the problem is in the file Microsoft.Cpp.Win32.targets in C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32. There is a typo for the KeyFile attribute for the second link. I fixed it by changing line 441:

        KeyFile                        ="%(Link.KeyFile)"
    

    to

        KeyFile                        ="$(LinkKeyFile)"
    

    With that change the second linker pass included the /KeyFile qualifier and the .DLL was properly built with the publickey embedded.

提交回复
热议问题