且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

程序集绑定错误:绑定结果:hr = 0x80070002.该系统找不到指定的文件

更新时间:2023-11-18 22:47:40

所以事实证明无法找到程序集的原因是因为我们是 延迟签署程序集 这意味着:

So it turns out the reason the assembly could not be found was because we are Delayed Signing the Assemblies this means that:

因为程序集没有有效的强名称签名,必须关闭对该签名的验证.您可以通过在强名称工具中使用 –Vr 选项来完成此操作.

Because the assembly does not have a valid strong name signature, the verification of that signature must be turned off. You can do this by using the –Vr option with the Strong Name tool.

我已经为所有必需的公钥执行了此操作,但仅在 x64 Visual Studio 命令提示符下执行.我还需要在 Visual Studio 命令提示符的 x86 版本中为 x86 添加验证跳过.

I had already done this for all required public keys however ONLY in the x64 Visual Studio command prompt. I also needed to add the verification skipping for x86 in the x86 version of the Visual Studio Command Prompt.

我只是设法找到了这一点,因为在尝试基于特定命令的构建/部署脚本时,我注意到其中一个测试程序集出现以下异常:

I only managed to find this because trying a specific command based build/deployment script i noted the following exception with one of the test assemblies:

无法加载文件或程序集ProjectC.Tests,版本=0.0.0.0,Culture=neutral, PublicKeyToken=e72f8d3506b83180' 或其中之一依赖关系.强名称验证失败.(HRESULT 的例外:0x8013141A)

Could not load file or assembly 'ProjectC.Tests, Version=0.0.0.0, Culture=neutral, PublicKeyToken=e72f8d3506b83180' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)