脚手架错误:deps.json不存在

编程入门 行业动态 更新时间:2024-10-26 12:35:11
本文介绍了脚手架错误:deps.json不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我当前正在使用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:\Users\xxx\Documents\Visual Studio 2017\Projects\bin\MCD\Debug\netcoreapp1.1 \[project name].deps.json] does not exist"

当我浏览解决方案文件夹时,我发现bin目录中有两个文件夹,调试和 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新控制台 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

推荐答案

在这里找到了答案: github/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 ,而不是常规的 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不存在

本文发布于:2023-11-13 10:18:11,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1584115.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:脚手架   不存在   错误   deps   json

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!