Eric
Eric

Reputation: 1088

The specified deps.json [] does not exist - Blazor WebAssembly App project type

I have seen similar posts to this but I have not been able to get a solution to make this work.

I spin up a new app and try any ef command and I get this message. I've never gotten this before in any version of VS and I have not found any real solutions to fix it.

I've deleted the bin and obj folders, updated VS, tried copying files to root, restarted my machine after updating.

The specified deps.json [] does not exist

I'm on VS2019 16.10.1 NET Core 5.0

Scaffold-DbContext that has worked in the past is not working at all now.

Scaffold-DbContext "Server=servername;User Id=sa;Password=argh;Database=arghdb" Microsoft.EntityFrameworkCore.SqlServer -ContextDir Context -OutputDir Models 

Not sure what to do right now. This is crippling.

Please describe the issue in 2-3 sentences. Include what you're trying to accomplish when the issue occurs.

I am trying to scaffold a database in ef core within a blazor project.

When did it begin and how often does it occur? Every time migrations/scaffolding is tried in a blazor project

What errors do you see?

The specified deps.json [...bin\Debug\net5.0\CourtFilings.Web.deps.json] does not exist

What's the environment and are there recent changes? No recent changes. Just updates to VS2019

What have you tried to troubleshoot this? I tried setting the startup project. I have not found another option.

This is what I try that does not work

Scaffold-DbContext "Server=server;User Id=sa;Password=password;Database=database;" Microsoft.EntityFrameworkCore.SqlServer -ContextDir Context -OutputDir Models -Tables CourtFilings -startupproject CourtFilings.Web

This does work in an ASP.net core web project. Just not Blazor. This has worked in a previous Blazor project.

Upvotes: 4

Views: 5854

Answers (3)

Dindar
Dindar

Reputation: 3245

Just for those who have a similar problem regarding "The specified deps.json does not exist". I had problem with adding scaffold item Razor Page in Rider. I followed multiple solutions such as :

  • Cleaning and rebuilding project
  • Adding IDE to OS path variable
  • Setting Startup Project
  • Adding MyProjectName.spec.json file manually (it causes another MyProjectName.runtimeconfig.json missing, maybe manually borrowing those two files from a working project works though)

But they didn't work. For me Instead of using IDE (mine is Rider) for project creation, I used Dotnet-CLI command such as

Dotnet new Blazor -o BlazorApp1

And it worked. I hope this helps, especially if you are using Rider which there is a reported bug but it's not resolved yet

Upvotes: 0

Johan
Johan

Reputation: 323

Change your startup project to the project containing your context rather than the Web.Client app during scaffolding

Upvotes: 10

Eric
Eric

Reputation: 1088

Well. This appears to only be happening only with the Blazor WebAssembly App project type.

I just tried this on an new ASP.NET Core Web App and I didn't have the problem.

Hopefully this helps someone else.

Upvotes: 1

Related Questions