简体   繁体   English

强名验证不会因修改的程序集而失败

[英]Strong name verification does not fail for modified assembly

I followed this video , and the steps I did were: 观看了视频 ,然后执行的步骤是:

  1. I make a strong named assembly, a.dll from a C# class. 我创建了一个强命名程序集,来自C#类的a.dll。
  2. I make b.exe from a C# class that has a reference for a.dll (a class like Program.cs in Console Application). 我从具有a.dll引用的C#类(类似于Console Application中的Program.cs的类)制作b.exe。
  3. I run b.exe, and it executes correctly. 我运行b.exe,它可以正确执行。
  4. I modify the strong named a.dll, and verify that by sn -v a.dll command, and the response is: " Failed to verify assembly -- Strong name validation failed. " 我修改了强名称a.dll,并通过sn -v a.dll命令进行了验证 ,响应为:“ 验证程序集失败-强名称验证失败。
  5. Again I run b.exe and it works, but I expect a FileLoadException error because it's a modified assembly. 再次运行b.exe,它可以工作,但是我期望出现FileLoadException错误,因为它是经过修改的程序集。 In this video the error occurs! 在此视频中发生错误!

My results are not the same as seen in the video. 我的结果与视频中看到的结果不同。 Is there a reason for this? 是否有一个原因?

I'm guessing you're using .NET 3.5 SP 1 or later, and I'm guessing the video is based on an earlier version, or has applied the below fix to disable the "Strong Name Signing Bypass". 我猜您正在使用.NET 3.5 SP 1或更高版本,并且我猜视频是基于较早版本的,或者已应用以下修补程序禁用了“强名称签名绕过”功能。

Please visit How to: Disable the Strong Name Signing Bypass Feature 请访问如何:禁用强名签名绕过功能

Starting with the .NET Framework version 3.5 Service Pack 1 (SP1), strong-name signatures are not validated when an assembly is loaded into a full-trust AppDomain ... Bypassing the validation of strong-name signatures provides significant performance improvements 从.NET Framework 3.5 Service Pack 1(SP1)开始,将程序集加载到完全信任的AppDomain中时,不对强名称签名进行验证...绕过对强名称签名的验证可显着提高性能

So, they changed the rules, provided you're running in full-trust. 因此,只要您以完全信任的身份运行,他们就会更改规则。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 程序集生成失败-引用的程序集“ XXXX”没有强名称 - Assembly generation failed — Referenced assembly 'XXXX' does not have a strong name 检查程序集是否有强名称 - Checking an assembly for a strong name 无法通过Assembly.LoadFrom()加载强名称程序集,调用失败,并显示0x80004005(E_FAIL) - Cannot load a Strong name assembly by Assembly.LoadFrom(), call fails with 0x80004005 (E_FAIL) 如何修复“引用的程序集没有强名称”错误 - How to fix "Referenced assembly does not have a strong name" error 强名称签名验证程序集的哪些部分 - What parts of an assembly does the strong name signing verify 参考没有强名称的汇编 - Reference to assembly without strong name 程序集生成失败-引用的程序集“ Interop.Office”没有强名称 - Assembly generation failed — Referenced assembly 'Interop.Office' does not have a strong name 程序集生成失败-引用的程序集“ Google.Apis”没有强名称 - Assembly generation failed — Referenced assembly 'Google.Apis' does not have a strong name 错误8程序集生成失败-引用的程序集'LibUsbDotNet'没有强名称 - Error 8 Assembly generation failed — Referenced assembly 'LibUsbDotNet' does not have a strong name 引用程序集“ CitiReusableCode”没有强名称的意思是什么,以及如何解决它? - What does Referenced assembly 'CitiReusableCode' does not have a strong name mean and how to solve it?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM