简体   繁体   中英

How do I deploy System.Management.Automation?

I am helping out with a project that a contractor worked on previously (so I don't have a lot of history for it).

The project builds fine, but when we try to perform some operations, we get a runtime error indicating that System.Management.Automation.dll could not be found.

As a troublshooting measure, we manually installed the dll into the installation directory. We then get an error indicating failure to load Microsoft.Management.Infrastructure.

As nearly as I can tell, these dlls are present in the Microsoft Management Framework download, and possibly in Powershell 3.0.

My question: What is the smallest package that these dlls are a part of, and what is the best way to deploy them for a production software release?

Edit

Just to be clear -- I am not looking to hack/frankenbuild by deploying just those dlls "naked", I am trying to identify the correct redistributable package for those dlls. I just can't seem to work out which one it is.

Edit

If it helps, the nature of the code that we are running is to programmatically create an exchange mailbox.

I think you can't legally redistribute any of those two DLLs alone (discussed for example here for the Automation, you can also check the "Redistributable" section on MSDN for those namespaces). You will have to make sure the target machines have PowerShell and the Management Framework.

Just in case anyone else runs into this problem: We ended up resolving the issue by deploying the Windows Management Framework 3.0, which includes the necessary assemblies. http://www.microsoft.com/en-us/download/details.aspx?id=34595

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM