[英]I have to run “dotnet restore” through the Package Manager Console before being able to build my applications
I had a problem where I received the error: Nuget error when trying to build my applications.我遇到了一个问题,我收到错误:尝试构建我的应用程序时出现Nuget 错误。 I found a solution here The solution was to run
dotnet restore
through the Package Manager Console.我在这里找到了解决方案解决方案是通过 Package 管理器控制台运行
dotnet restore
。 It helped, but ever since I have to do it for every single project I make.它有帮助,但自从我必须为我所做的每一个项目做这件事以来。 Before this error I have never had this problem
在这个错误之前我从来没有遇到过这个问题
It are .net Core projects in visual studio community 2019它是 Visual Studio 社区 2019 中的 .net 核心项目
Is there something I can change so I don't have to run dotnet restore
before every build.有什么我可以改变的,所以我不必在每次构建之前运行
dotnet restore
。
Edit: added what I was looking for编辑:添加了我正在寻找的内容
I once had the same problem when working on Xamarin Forms application, I noticed the problem occurred when there was a disruption in the build/compiling process, because I had experienced power shortage and the laptop went off in between the process.我曾经在处理 Xamarin Forms 应用程序时遇到同样的问题,我注意到在构建/编译过程中断时出现了问题,因为我遇到了电源短缺并且笔记本电脑在此过程之间关闭。
The fix was to delete the file projects.assets.json, and after that it compiled successfully.修复方法是删除文件 projects.assets.json,然后编译成功。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.