脚手架错误:deps.json 不存在 [英] Scaffolding error : deps.json doesn't exist
问题描述
我目前正在使用 VS2017 开发 .NET Core MVC Web
I'm currently using VS2017 for developing .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:UsersxxxDocumentsVisual Studio 2017ProjectsinMCDDebug
etcoreapp1.1
[project name].deps.json] does not exist"
浏览解决方案文件夹时,发现bin目录下有两个文件夹,Debug
和MCD
.
When I explored the solution folder, I found that there are two folder 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
我注意到从 Visual Studio Code 调试 .NET 控制台应用程序(我从 dotnet new console
cli 命令创建)时也遇到了同样的问题..deps.json 中遇到的同样问题无法找到
I noticed that I also got the same problem when debugging .NET Console app (which I created from dotnet new console
cli command) from Visual Studio Code. The same problem faced in .deps.json could not be found
有没有我遗漏的 .NET Core 配置?或者这是 .NET Core 中的错误?我记得在 VS2017 中安装我的 .NET Core 之前我没有配置任何东西
Are there any .NET Core configs that I missed? Or this is a bug in .NET Core? I remember I didn't configure anything prior from installing my .NET Core in VS2017
推荐答案
在这里找到答案:https://github.com/dotnet/coreclr/issues/113
显然,这是出现在 HP 计算机上的某种错误.我将引用 GitHub 问题:
Apparently, this is some kind of bug that appeared on HP computers. I'll quote from the GitHub issue :
他们有一个名为 Platform 的环境变量,设置为 MCD,这就是您看到此错误的原因.
they have an environment variable called Platform, set to MCD which is why you are seeing this error.
这会导致 .NET Core 在您的 bin
的 MCD 文件夹中查找文件,而不是您的普通 Debug
文件.您所要做的就是删除变量或将其设置为空
This cause .NET Core to look for the file at MCD folder of your bin
, instead of your normal Debug
file. All you have to do is delete the variable or set it to nothing
这篇关于脚手架错误:deps.json 不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!