admin管理员组

文章数量:1122846

Visual Studio 2022 (17.11.6) .Net 8.0

I have a project where I currently need to update my model after I added a field to the DB. I run the following scaffolding command using the Package Manager Console:

Scaffold-DbContext 'Name=ConnectionStrings:'Entities' Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -Force -Context EntityContext

It successfully builds the project, but then throws the following error:

The specified deps.json [\\SomeServer\ThisProject\bin\Debug\net8.0\ThisProject.deps.json] does not exist

However, if I copy that exact folder path (except the leading two escape slashes) and paste it into Windows Explorer, it brings me to that folder and the file "ThisProject.deps.json" is in there.

I have tried deleting the "obj" and "bin" and ".vs" folders. No change. I have tried deleting the "ThisProject.deps.json" file itself. It just gets recreated every time I build the project. I have tried updated Visual Studio. No change. I have tried updated all my Entity Framework packages. No change. I have tried setting this as the default project (there is only one project in this solution so I don't see how that would matter anyway). No change.

I will note that where I work requires me to run this project as admin.

Visual Studio 2022 (17.11.6) .Net 8.0

I have a project where I currently need to update my model after I added a field to the DB. I run the following scaffolding command using the Package Manager Console:

Scaffold-DbContext 'Name=ConnectionStrings:'Entities' Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -Force -Context EntityContext

It successfully builds the project, but then throws the following error:

The specified deps.json [\\SomeServer\ThisProject\bin\Debug\net8.0\ThisProject.deps.json] does not exist

However, if I copy that exact folder path (except the leading two escape slashes) and paste it into Windows Explorer, it brings me to that folder and the file "ThisProject.deps.json" is in there.

I have tried deleting the "obj" and "bin" and ".vs" folders. No change. I have tried deleting the "ThisProject.deps.json" file itself. It just gets recreated every time I build the project. I have tried updated Visual Studio. No change. I have tried updated all my Entity Framework packages. No change. I have tried setting this as the default project (there is only one project in this solution so I don't see how that would matter anyway). No change.

I will note that where I work requires me to run this project as admin.

Share Improve this question edited Nov 22, 2024 at 4:21 Jason Pan 21.5k2 gold badges19 silver badges39 bronze badges asked Nov 21, 2024 at 22:31 Ross EkbergRoss Ekberg 32 bronze badges 3
  • I found you are using \\SomeServer, it should be a problem caused by the network path. Could you create a sample and verify it in local, thanks. – Jason Pan Commented Nov 22, 2024 at 4:51
  • Hi Ross, after checking a lot of github issues, I found it's a know issue for network path, and I will summarize all the details below, hope it can help others who will face the same issue in the future. – Jason Pan Commented Nov 22, 2024 at 5:34
  • That's odd since it has never been a problem before. I always run my projects across the network, never locally. We have other developers here doing the same thing and they aren't experiencing this problem. – Ross Ekberg Commented Nov 22, 2024 at 14:18
Add a comment  | 

1 Answer 1

Reset to default 0

Use Scaffold-dbcontext and Add-Migration command, it will show the error message The specified deps.json [\\SomeServer\ThisProject\bin\Debug\net8.0\ThisProject.deps.json] does not exist if we are executing from a network drive that begins with two slashes. i.e. "\SomeServer...".

And it is working perfectly on local drive.

Related Links

The specified deps.json [\\TeamDrive\IT\Team Software\Project\etc...] does not exist#14349

deps.json not found due to extra backslashes being added to search path for a network drive beginning with '\' #21048

本文标签: net 80The Specified depsjson Does Not Exist Even Though It DoesStack Overflow