为什么在混合模式程序集缺少AssemblyDelaySign(true)的情况下,强名称验证有时仅会失败? [英] why does strong name validation only sometimes fail if AssemblyDelaySign(true) is missing for a mixed-mode assembly?

查看:199
本文介绍了为什么在混合模式程序集缺少AssemblyDelaySign(true)的情况下,强名称验证有时仅会失败?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在.Net 4中发现了一个关于延迟签名程序集的相当奇怪的行为.

I recently discovered a rather odd behavior in .Net 4 concerning delay-signed assemblies.

设置如下:

-foo.exe是使用bar.dll的本地Win32应用程序

- foo.exe is a native win32 app which uses bar.dll

-bar.dll是一个包含本机代码和托管代码(.Net 4)的混合模式程序集,它使用sn.exe签名,但是没有AssemblyDelaySign属性

- bar.dll is a mixed-mode assembly containing native and managed code (.Net 4), it is signed with sn.exe, but it has no AssemblyDelaySign attribute

 

现在,在大多数安装中,我们都没有遇到任何问题.您启动foo.exe,它将加载bar.dll并正常运行.

Now on most installations, we haven't had a problem with this. You launch foo.exe, it loads bar.dll and runs just fine.

但是,在某些情况下却没有,并且bar.dll出现这样的错误:

On some, however, it does not and you get an error like this for bar.dll:

异常类型:   System.IO.FileLoadException

消息:无法加载文件或程序集栏,Version = some.version.number,Culture = neutral,PublicKeyToken = whatever"或其依赖项之一.强的 名称验证失败. (来自HRESULT的异常:0x8013141A)

Message:          Could not load file or assembly 'bar, Version=some.version.number, Culture=neutral, PublicKeyToken=whatever' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)

InnerException:   System.Security.SecurityException

是否可能对.Net 4进行了更新,从而导致有关是否需要该属性的行为发生了变化?

Was there maybe an update to .Net 4 that caused a change in behavior as to whether or not that attribute is required?

还是有某种方法可以将.Net 4配置为以一种或另一种方式运行?

Or is there some way to configure .Net 4 to behave one way or the other?

 

推荐答案

Hi,

 

感谢您的问题,我们正在研究这种情况,可能需要一些时间才能回复您.

Thank you for your question, we're doing research on this case, it might take some time before we get back to you.


这篇关于为什么在混合模式程序集缺少AssemblyDelaySign(true)的情况下,强名称验证有时仅会失败?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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