0

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 dotnet. Then I start pocking around and somehow it fixes again (it can take a lot of time).

The weird thing is that dotnet 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?

Notbad
  • 5,936
  • 12
  • 54
  • 100

2 Answers2

0

I had the same issue. It happens randomly. Lost a couple of hours from my life until I found a workaround that solves the issue.

I am using:

  • NuGet Package Manager Console (NuGet 5.6.0.5)
  • in Visual Studio for Mac COMMUNITY Version 8.6.1
  • and use it for Entity Framework commands

Example command:

PM> Update-Database
Build started...
Build succeeded.
The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: The term 'dotnet' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

A couple of minutes ago realized that by cleaning the project the issue goes away.

Visual Studio -> Build -> Clean All

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 I am about to reconsider this issue. Hope they will come up with a fix.

apphipster
  • 16
  • 1
0

The disk space was running out in my machine. Improving the available storage for around 5GB. Then reinstalled the NuGet Package Manager Console. It worked!