deps.json file is not found in project root folder

2.5k views Asked by At

I run the following command in Package Manager in Visual Studio 2019 and a ASP.NET Core 5 project:

Scaffold-DbContext "Server=(local);Database=MyDB;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Entities -Context ApplicationDbContext

After a little time, this error appears:

The specified deps.json [C:\WorkingFolder\Projects\MyProject\MyProject.deps.json] does not exist

Notice that the deps.json file is being searched in project root, not under bin folder such as other posts I have found here, so by deleting bin and obj folder does not help.

How to solve it?

2

There are 2 answers

1
nasir taha On

I am able to solve the same issue by setting the project contains the EF core files as a startup project.

0
Bdruid On

Same problem: VS 2019 16.10.3 Professional

Add-Migration init
Build started...
Build succeeded.

The specified deps.json [C:\Users\USER\source\repos\FirstAspCore\FirstAspCore\FirstAspCore.deps.json] does not exist

Attempted Solution 1:

Copied the FirstAspCore.deps.json located at the bin/debug/netcore3.1 to the root

PM> Add-migration init
Build started...
Build succeeded.

It was not possible to find any compatible framework version

The framework 'Microsoft.NETCore.App', version '2.0.0' was not found.

The following frameworks were found:
 3.1.16 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  5.0.0 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  5.0.7 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

You can resolve the problem by installing the specified framework and/or SDK.

The specified framework can be found at:

Attempted solution 2:

Even if u download all The frameworks 'Microsoft.NETCore.App', version '2.0.0' then will prompt for older version and u download it ,at the end will not work

Attempted Solution 3:

Copied everything from the location bin/debug and pasted in the root folder ,it is an insufficient way, but figuring out which are needed going to take time, it worked for now.

PM> Add-Migration init
Build started...
Build succeeded.

 Microsoft.EntityFrameworkCore.Infrastructure[10403]
   Entity Framework Core 5.0.8 initialized 'Helper' using provider 
   'Microsoft.EntityFrameworkCore.SqlServer' with options: None
    To undo this action, use Remove-Migration.