Forest error: deps.json does not exist

I am currently using VS2017 to develop the .NET Core MVC Web

When I tried to create a new controller from Add> Controller, I got this error

Error There was an error running the code generator: "The specified deps.json [C:\Users\xxx\Documents\Visual Studio 2017\Projects\bin\MCD\Debug\netcoreapp1.1 \[project name].deps.json] does not exist" 

When I examined the solution folder, I found that there are two folders in the bin directory, Debug and MCD .

 bin | - Debug - netcoreapp1.1 - ... - [project name].deps.json | - MCD <- this is where the scaffolding looks for deps.json 

I noticed that I also had the same problem when debugging a .NET Console application (which I created from the dotnet new console cli command) from Visual Studio code. Could not find the same problem as in .deps.json

Are there any .NET Core configurations that I missed? Or is this a bug in .NET Core? I remember I didn’t configure anything before installing my .NET Core in VS2017

+5
source share
3 answers

Found the answer here: https://github.com/dotnet/coreclr/issues/113

Apparently, this is some kind of error that appeared on HP computers. I will quote from the GitHub issue:

they have an environment variable called Platform set in the MCD, so you see this error.

This causes .NET Core to search for the file in the MCD folder of your bin instead of the regular Debug file. All you have to do is delete the variable or set it with nothing.

+8
source

VS 2017 file searches in

[C: \ Users \ xxx \ Documents \ Visual Studio 2017 \ Projects \ bin \ MCD \ Debug \ netcoreapp1.1 [project name] .deps.json]

similar to

[C: \ Users \ xxx \ Documents \ Visual Studio 2017 \ Projects \ bin \ Debug \ netcoreapp1.1 [project name] .deps.json]

So, I just copied the contents from the second folder to the first and it worked. No need to change environment variables.

+1
source

I had the same issue in VS2017. My solution was to remove the Platform variable in the environment variables. You must also restart VS2017.

0
source

Source: https://habr.com/ru/post/1265369/


All Articles