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
Anonymous
July 15, 2010
I adore your site, looks excellent and full of good info. Keep it up.Anonymous
July 15, 2010
I adore your site, looks excellent and full of good info. Keep it up.Anonymous
October 12, 2013
works for me. thanks!Anonymous
April 09, 2014
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!Anonymous
November 18, 2014
Edmond you have to install windows sdk to get System.Management.Automation.dll