Cannot add package to visual studio. (System.Management.Automation)

755 Views Asked by At

Trying to add System.Management.Automation package to my project in visual studio because I want to run powershell commands through my code, but am getting the error:

The project does not support adding package references through the add package command. My dotnet --version is: 7.0.102

I inputted

dotnet add package System.Management.Automation --version 7.3.2

into the package manager console, and was expecting it to work as normal when adding a nuget package, however instead received the error

Error while adding package 'System.Management.Automation' to project 'C:\Users\userone\source\repos\blackjack21\blackjack21.csproj'. The project does not support adding package references through the add package command.

No idea what to do.

0

There are 0 best solutions below