Project 'Default' not found error when installing a NuGet package
Solution 1
Such an error occured to me, I fixed it simply by choosing the project at the console
Solution 2
Simple solution, but I just restarted VS 2017 and I was able to run the Add-Migration "XXXXXX" command.
Solution 3
I fixed this by closing down VS and reopening the solution. Now I can install packages with Nuget.
Also someone said something about choosing the project from the drop-down as the default project, My drop-down was blank. In case the problem you are having is similar...try restarting the solution. Worked for me
Solution 4
try this:
- Open a command prompt in the root source directory of your application (where "project.json" is)
-
Run
dotnet ef migrations add MyFirstMigration
and
dotnet ef database update
For your packages try to edit your "project.json" file and add new dependencies and run:
dotnet restore
Look at:
- https://docs.efproject.net/en/latest/miscellaneous/cli/dotnet.html for the ef tool documentation.
- https://docs.microsoft.com/en-us/dotnet/articles/core/tools/dotnet-restore for the restore documentation.
- https://docs.microsoft.com/en-us/dotnet/articles/core/tools/project-json#dependencies for the "project.json" documentation
Solution 5
that nuget you want to install is not compatible with current project framework
- right click on project name at solution explorer panel and choose properties
- in the application tab change target framework to newest one.
- close and try again to install-package
nam
Updated on August 22, 2020Comments
-
nam over 3 years
I copied the following project from win 8.1 to windows 7 and deleted the Migration folder. Now when I run
PM> Add-Migration MyFirstMigration -context BloggingContext
command in VS2015 I get the error:Project "Default" is not found
. Both the machines have ASP.NET Core 1.0 and VS2015-Update 3 installed. I get the same error if I runInstall-Package
command for any package. Project runs fine on Win8.1UPDATE
I do not have the same issue when copying a project from Windows 7 to Windows 8.1 or after I upgraded from windows 7 to Windows 10. Maybe, the above issue has something to do with copying a project from a higher version to lower version