强名验证用户反馈 [英] strong name validation user feedback

查看:84
本文介绍了强名验证用户反馈的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了尝试了解强名的用法,我想建立一个小型实验.

In an attempt to see the usage of strong name I wanted to build a small experiment.

创建一个使用AxInterop和Interop程序集的简单.NET 2.0 C#窗体应用程序.所有三个程序集均已签名.

Create a simple .NET 2.0 C# forms application that uses an AxInterop and Interop assemblies. All three assemblies are signed.

运行该应用程序,表格将按预期显示.

Ran the application and the form is shown as expected.

然后,我对AxInterop \ Interop的源代码进行了更改,重新编译了代码,并为程序集提供了新的版本号.

Then I made a change to source code of the AxInterop\Interop, recompiled the code and gave the assembly a new version number.

从资源管理器中运行该应用程序,并且该应用程序未启动,并且未显示任何错误消息.不过,首先我确实真的双击了该图标,所以我再次尝试了,但是还是发生了同样的情况.甚至尝试过控制台模式,但没有反馈. fuslogvw输出,并正确指出程序集引用与程序集定义不匹配,并且版本号不匹配.奇怪的是缺少用户反馈.这是正确的行为吗?普通用户不会知道为什么 应用程序未按预期启动.

Ran the application from explorer and the application did not start and no error message was displayed. First I though, did I really double click on the icon, so I tried again but the same happend. Even tried console mode but no feedback. Checked fuslogvw output and it states correctly that assembly reference did not match assembly definition and that there was revision number mismatch. What was odd is the lack of user feedback. Is this correct behaviour? A regular user would not have a clue why the application did not start as expected.

推荐答案

据我了解,CLR使用公共密钥对程序集中包含的哈希密钥进行解密,计算程序集的哈希键,然后将两者进行比较.如果它们相同,则一切正常.如果它们不同,该怎么办? 装配由于某种原因被更换了吗? CLR在这种情况下会杀死应用程序还是上下文很重要?例如,如果第6层上的叶子由于强名而失败,那么您可能拥有带有装配体树结构的庞大结构 杀死该应用程序似乎很奇怪.强名称验证失败时,托管.NET程序集是否会对行为产生任何影响?

From what I can understand the CLR decrypts the hash key included in the assembly using the public key, calculates a hash key of the assembly and compares the two. If they are the same everything works fine. What should happen if they are different, i.e. the assembly has been changed for whatever reason? Does the CLR kill the application in this situation or does the context matter? For instance, you might have a huge with a tree structure of assemblies, if a leaf assebly on level 6 fails due to strong name it seems odd to kill the application. Does the hosting .NET assembly have any inpact on the behaviour when strong name validation fails?


这篇关于强名验证用户反馈的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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