在Windows 8 RTM中的.NET应用程序中嵌入Powershell v2.0
在从Windows 7升级之前尝试运行托管的PowerShell脚本时,我收到以下错误我从来没有收到此错误。
我已经在App.config中应用了以下内容 <dependentAssembly> <assemblyIdentity name="System.Management.Automation" publicKeyToken="31bf3856ad364e35" /> <publisherPolicy apply="no" /> </dependentAssembly> 可能是什么问题?
解决方案是执行以下操作,而不是仅添加一个仅适用于System.Management.Automation的块,如我阅读的帖子所建议的,您需要为所有引用的PS程序集添加一个块。
<runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Management.Automation" publicKeyToken="31bf3856ad364e35" /> <publisherPolicy apply="no" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.PowerShell.Commands.Utility" publicKeyToken="31bf3856ad364e35" /> <publisherPolicy apply="no" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.PowerShell.ConsoleHost" publicKeyToken="31bf3856ad364e35" /> <publisherPolicy apply="no" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.PowerShell.Commands.Management" publicKeyToken="31bf3856ad364e35" /> <publisherPolicy apply="no" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.PowerShell.Security" publicKeyToken="31bf3856ad364e35" /> <publisherPolicy apply="no" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.PowerShell.Commands.Diagnostics" publicKeyToken="31bf3856ad364e35" /> <publisherPolicy apply="no" /> </dependentAssembly> </assemblyBinding> </runtime> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- windows-phone-7 – WP7的老化测试
- windows – 为什么COM CoInitializeSecurity在我的DLL中失败
- Emgu OpenCV的’cvextern.dll’的源代码在哪里?
- Windows-10 – Windows 10中的IE 11和Edge不允许更改仅适用
- Win10智能客户端默认安装路径
- 窗口 – 如何使批处理文件运行字符串作为命令?
- windows-7 – 如何在Windows 7中强制更新用户的组成员身份?
- 正确的方法来获得Windows控件的首选大小
- windows – 是否可以编写一个不会出现在打印屏幕上的应用程
- 如何在Windows Azure上安装OpenCV?
- windows-8 – Windows 8商店应用程序 – 使用哪种
- windows下安装并使用kafka
- 使用带Stretch的图像控制= UniformToFill – WP7
- windows-phone-7 – 是否隐藏Windows Phone 7应用
- 在windows下部署包含C3P0的war包没问题,部署到l
- windows-server-2012 – Office365 DirSync Acti
- windows-server-2008-r2 – 共享私有AMI:未显示
- RocketMQ在windows环境下的安装
- winforms – F#:尝试打开System.Windows.Forms时
- 使用Windows XP,Qt Creator 4.5.2(Windows 32位)