开发者

Multiple projects need to use 1 SNK file

I'm using Visual Studio 2008 and I have a solution which contains multiple projects. I have 1 snk to sign my assemblies and this lives in a solution folder.

I've linked the snk to each of my projects but now when I attempt to sign my project with that linked snk I can't find the snk file with the file dialog.

Have I missed a step here?

Solution
   > Solution Folder
       MyKey.snk
   > Project X
       > _LinkedFiles
           MyKey.s开发者_开发知识库nk (physical file doesn't appear here but shows in VS)
       > ...


Sharing a Strong Name Key File Across Projects:

http://blogs.msdn.com/shawnfa/archive/2006/04/24/582278.aspx


Well, not much response here but I did find a solution I was comfortable with. I've got a ProductAssemblyInfo which lives in a solution folder but is linked to each project as below.

Solution
   > Build (Solution Folder)
       MyKey.snk
       ProductAssemblyInfo.cs
   > Project X
       > _LinkedFiles
           ProductAssemblyInfo.cs
       > ...

The ProductLevelAssembly contains the following line:

[assembly: AssemblyKeyFile("../../Build/MyKey.snk")]

That way the key file never gets copied into each project but each assembly is still signed by the key.


Don't link it, just make copies of it. If you rebuild the SNK, you will need to copy it to all the projects again, but the likelihood of needing to do that is VERY low. In fact, we only change SNKs when modifying major version numbers.

Also when you link a file, you are linking it in the solution file, not making a copy which edits both places at once. The browse dialog is only going to show you files which exist on the drive.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜