Project 'Default' not found error when installing a NuGet package

36,035

Solution 1

Such an error occured to me, I fixed it simply by choosing the project at the console

enter image description here

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:

  1. Open a command prompt in the root source directory of your application (where "project.json" is)
  2. 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:

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
Share:
36,035
nam
Author by

nam

Updated on August 22, 2020

Comments

  • nam
    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 run Install-Package command for any package. Project runs fine on Win8.1

    UPDATE

    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