【问题标题】:visual studio 2010 system.management.automation assembly referencevisual studio 2010 system.management.automation 程序集参考
【发布时间】:2010-12-15 22:38:17
【问题描述】:

Visual Studio 2010 遇到问题

我添加了对项目的引用并仔细检查了 当我使用 System.Management.Automation 键入时; 在文件的顶部。

当我去编译/构建它时..
它说臭名昭著的是您是否缺少程序集参考。
有任何想法吗?

【问题讨论】:

  • 我无法复制这个。我从 Program Files\Reference Assemblies\WindowsPowerShell\v1.0 目录中添加了对 Sys.Mngmnt.Automation 的引用,构建了一个小型测试应用程序,它在 VS2010 Beta 2 上编译和运行良好。
  • 你能发布你的项目的 .csproj 文件吗?
  • 是的 ...SCRNetworkFailure.csproj 啊我只有 beta 1 生病尝试更新并让你知道

标签: c# visual-studio-2010 powershell


【解决方案1】:

随着时间的推移,我在 System.Management.Automation 方面遇到了各种各样的问题。我最近再次点击它,并决定找到一种替代方法,使用批处理文件从 .NET 运行 PowerShell。有关代码示例,请参阅此博客文章: http://www.nootn.com.au/2013/01/run-powershell-from-net-program-without.html

这也提到了如何让 System.Management.Automation 工作; IE。安装 Windows SDK 并破解 csproject 文件,使其具有:

<Reference Include="System.Management.Automation" />

我希望这有助于解决您的问题或解决它!

【讨论】:

  • 感谢您的投入,这是以前的工作职位,所以现在与我无关,但如果它对其他人有帮助.. 太好了! :)
猜你喜欢
  • 2014-01-27
  • 1970-01-01
  • 2011-12-25
  • 1970-01-01
  • 1970-01-01
  • 2012-11-04
  • 1970-01-01
  • 2021-09-01
  • 1970-01-01
相关资源
最近更新 更多