开发者

Strongly name three assemblies that reference each other

开发者_JAVA技巧

This is probably really easy, but I'm stumped (and I'm a noob with c#). I have 3 assemblies that reference each other (for example, registering for notification of a delegate method, or calling a public method), all of which compile fine until I try to sign them with a strong name. Then I can't compile any of them, since the other two don't have a strong name. What am I missing? I've created a strong name file for all three, but can't include the snk and compile them.


If you have created one snk file that you want to use on all three of them choose: Add Existing Item from the context menu on the projects.

Browse to the snk file and then choose "Add as link" by clicking on the arrow next to the Add button.

Then in your project properties make sure in the tab Signing check the "Sign the assembly" checkbox and then select the keyfile you just added to your project.

That should do the trick.


A strongly named assembly can only reference other strongly named assemblies.

When you reference a strong-named assembly, you expect to get certain benefits, such as versioning and naming protection. If the strong-named assembly then references an assembly with a simple name, which does not have these benefits, you lose the benefits you would derive from using a strong-named assembly and revert to DLL conflicts. Therefore, strong-named assemblies can only reference other strong-named assemblies.

Quoted from MSDN.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜