2
Answers

System.Management.Automation namespace not found

James Alcroft

James Alcroft

8y
1.4k
1
Hi
 
I have just upgraded to Windows 10 and one of my libraries fails to compile. The library uses System.Management.Automation and System.Management.Automation.RunSpaces so that I can run PowerShell.
 
This library compiles on Windows 7 & 8, so I know the code is good.
 
The error: 
 
Error 3 The type or namespace name 'Automation' does not exist in the namespace 'System.Management' (are you missing an assembly reference?)
 
I get this same error regardless of which system.management.automation.dll I use, that is the one in 'C:\Program Files (x86)\Reference Assemblies\Microsoft\WindowsPowerShell\3.0' or  'C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Management.Automation\v4.0_3.0.0.0__31bf3856ad364e35', the latter is the one which we have in our library which compiles on Win 7/8.
 
How can I get around this? I want to upgrade our development team in the new year, but this problem will stop that from happening.
 
Many thanks.
 
James 
 
Answers (2)