加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net-mvc – 脚手架错误:deps.json不存在

发布时间:2020-12-16 03:31:21 所属栏目:asp.Net 来源:网络整理
导读:我目前正在使用VS2017开发.NET Core MVC Web 当我尝试从Add创建一个新的Controller时控制器,我收到了这个错误 ErrorThere was an error running the code generator: "The specified deps.json[C:UsersxxxDocumentsVisual Studio 2017ProjectsbinMCD
我目前正在使用VS2017开发.NET Core MVC Web

当我尝试从Add>创建一个新的Controller时控制器,我收到了这个错误

Error

There was an error running the code generator: "The specified deps.json
[C:UsersxxxDocumentsVisual Studio 2017ProjectsbinMCDDebugnetcoreapp1.1
[project name].deps.json] does not exist"

当我探索解决方案文件夹时,我发现bin目录中有两个文件夹,Debug和MCD.

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

我注意到在从Visual Studio Code调试.NET Console应用程序(我使用dotnet new console cli命令创建)时,我也遇到了同样的问题. .deps.json could not be found面临同样的问题

我错过了任何.NET Core配置吗?或者这是.NET Core中的错误?我记得在VS2017中安装.NET Core之前我没有配置任何东西

解决方法

在这里找到答案: https://github.com/dotnet/coreclr/issues/113

显然,这是HP计算机上出现的某种错误.我将引用GitHub问题:

they have an environment variable called Platform,set to MCD which is why you are seeing this error.

这会导致.NET Core在bin的MCD文件夹中查找文件,而不是普通的Debug文件.您所要做的就是删除变量或将其设置为空

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读