【发布时间】:2015-01-28 22:57:01
【问题描述】:
我制作了一个使用 C:\Program Files (x86)\Reference Assemblies\Microsoft\WindowsPowerShell\3.0\System.Management.Automation.dll 的 c# 应用程序
我还将 dll 复制到我的 bin 文件夹中。它工作正常,但如果我将 bin 文件夹复制到另一台机器并运行可执行文件,我会收到此错误:
************** Exception Text **************
System.IO.FileLoadException: Could not load file or assembly 'System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)
File name: 'System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' ---> System.Security.SecurityException: Strong name validation failed. (Exception from HRESULT: 0x8013141A)
注意:我根本没有签署程序集。 此外,我不想通过修改注册表项来禁用安全性。我只想正确修复它。 任何想法如何在不全局注册 dll 的情况下解决此问题?
更新:我尝试将整个 Visual Studio 项目复制到另一台机器上。它在 Windows 8 上运行时无法在 Windows 7 上运行。
【问题讨论】: