1

Been having trouble with visual studio 2010

I've added reference to the project and double checked the when i type using System.Management.Automation; at the top of the file.

when I go to compile / build it ..
it says that the infamous are you missing an assembly reference.
any ideas?

3
  • I can't repro this. I have added a reference to Sys.Mngmnt.Automation from the Program Files\Reference Assemblies\WindowsPowerShell\v1.0 dir, built a small test app and it compiles and runs fine on VS2010 Beta 2.
    – Keith Hill
    Commented Nov 13, 2009 at 15:15
  • Could you post your .csproj file for the project?
    – Itay
    Commented Nov 13, 2009 at 23:20
  • yeah ... SCRNetworkFailure.csproj ah i've only got the beta 1 ill try updating and let you know
    – Rhys Evans
    Commented Nov 18, 2009 at 10:17

1 Answer 1

1

I have had all sorts of issues with System.Management.Automation over time. I recently hit it again and decided to find an alternative way to run PowerShell from .NET using a batch file. See this blog post for code samples: http://www.nootn.com.au/2013/01/run-powershell-from-net-program-without.html

This also mentions how to get System.Management.Automation working; I.e. install a windows SDK and hack the csproject file so it has:

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

I hope this helps solve your issue or work around it!

1
  • Thanks for your imput, this was for a prior employment position so not relevant to me now but if it helps some one else.. Great!! :)
    – Rhys Evans
    Commented Jan 14, 2013 at 15:35

Not the answer you're looking for? Browse other questions tagged or ask your own question.