C#:为什么签订组装? [英] C#: why sign an assembly?

查看:81
本文介绍了C#:为什么签订组装?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一些C#code我接管了(在Visual 工作室  2005年),我已经注意到,组件都与签署相同 .SNK 文件中。


  • 为什么会在previous笔者签署这样的组件?

  • 签署是必要的组件,什么
    错就错与不签?

  • 有什么缺点
    签约组件 - 它会导致延迟


解决方案

  

为什么会在previous笔者以这种方式签署的组件?


不知道,也许他希望他的所有组件使用相同的密钥签名。


  

时签署组件必要的,什么是错不签呢?


没有,这不是必要的,但它是让你以确保组件的真实性的机构。它可以让你以确保装配尚未从笔者篡改,并且它的确起源。如果你想要把它们放到GAC这也是必要的。


  

有什么缺点在那里签署组件 - 它会导致延迟


签名的程序集只能加载其他签名的程序集。此外,他们是绑,你需要使用绑定重定向或重新编译应用程序,如果你想使用一个不同版本的特定版本的含义。有一个小的性能开销,以及由于签名的验证,但它是如此的小,你不应该受到关注。

In some C# code I have taken over (in Visual Studio 2005), I have noticed that the assemblies are all signed with the same .snk file.

  • Why would the previous author have signed the assemblies in this way?
  • Is signing assemblies necessary and what would be wrong with not signing?
  • What disadvantages are there in signing assemblies - does it cause delays?

解决方案

Why would the previous author have signed the assemblies in this way?

No idea, maybe he wanted all his assemblies to be signed with the same key.

Is signing assemblies necessary and what would be wrong with not signing it?

No, it is not necessary but it is a mechanism allowing you to ensure the authenticity of an assembly. It allows you to ensure that an assembly hasn't been tampered with and indeed it origins from this author. It is also necessary if you want to put them into the GAC.

What disadvantages are there in signing assemblies - does it cause delays?

Signed assemblies can only load other signed assemblies. Also they are tied to a specific version meaning that you need to use binding redirects or recompile the application if you wanted to use a different version. There's a little performance overhead as well due to the verification of the signature but it is so little that you shouldn't be concerned about.

这篇关于C#:为什么签订组装?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆