macosnugetvisual-studio-macdotnet-clipackage-manager-console

dotnet is not recognized as the name of a cmdlet in Visual Studio for Mac


This is a really weird thing that happens to me now and then. When using visual studio on mac and I use the NuGet Package Manager Console, sometimes it looses access to .NET. Then I start pocking around and somehow it fixes again (it can take a lot of time).

The weird thing is that .NET is installed, never was moved and I can run it in Terminal without any location. So, it is added to the Path.

Has anybody suffered from this problem? Is there any way to fix that?


Solution

  • Cleaning the project via Visual Studio -> Build -> Clean All will make the issue go away.

    Then when running again the command in NuGet PM it is executed without any issue.

    PM>  Update-Database
    Build started...
    Build succeeded.
    No migrations were applied. The database is already up to date.
    Done.
    

    The issue was also posted to the developer community web page, but was soon closed without any resolution: https://developercommunity.visualstudio.com/content/problem/913964/dotnet-the-term-dotnet-is-not-recognized-as-the-na.html