Windows 2008 Powershell C# : The type or namespace name ‘Management’ does not exist in the namespace ‘System’


I was trying to use power shell from within my C# application on Windows Sever 2008.This somehow took me sometime to located the DLL, so here it is.


Error 1 The type or namespace name ‘Management’ does not exist in the namespace ‘System’ (are you missing an assembly reference?) f:\samples\<application>\<application>\Program.cs 4 14 <application>


Added the reference to the System.Management.Automation.dll located at


C:\Program Files\Reference Assemblies\Microsoft\WindowsPowerShell\v1.0\System.Management.Automation.dll


Hope you find this post useful, Cheers !!! 


Jeevan Bisht : Support Escalation Engineer


 

Comments (5)

  1. nike rift says:

    I adore your site, looks excellent and full of good info. Keep it up.

  2. nike rift says:

    I adore your site, looks excellent and full of good info. Keep it up.

  3. Evi says:

    works for me.

    thanks!

  4. Edmond says:

    What do you adore about this site? There is no such file called automation.dll
    C:Program FilesReference AssembliesMicrosoftWindowsPowerShellv1.0System.Management.Automation.dll

    I have Visual Studio 2012, and I have the sample programs that are working fine, but the ones that I create have no System.management.automation

    It’s so frustrating!

  5. nick says:

    Edmond you have to install windows sdk to get System.Management.Automation.dll