C# Help.
My c# code has:
using System.Management.Automation;
however visual studio does not understand what Automation is and it gives me an error. Any ideas how to fix this issue?
10 Replies
U have to download this
https://www.nuget.org/packages/System.Management.Automation/
System.Management.Automation 7.4.0
Runtime for hosting PowerShell
In case ur using linux u just have to run the command
dotnet add package System.Management.Automation --version 7.4.0
In windows if ur using purple visual studio its inside project tab u can see option for nuget
@SY i have it downloaded.
install this
this one is different
okay, one sec
okay i downloaded it
the issue still seems to be there
what is ur net ?
4.7.2
this require net 8.0
How do i fix the issue then?
just create a new console and make sure it uses .NET8.0