简体   繁体   English

在能够构建我的应用程序之前,我必须通过 Package 管理器控制台运行“dotnet restore”

[英]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.

相关问题 dotnet 核心是否具有用于控制台应用程序的内置 JSON 序列化器/反序列化器? - Does dotnet core have a built in JSON serializer/deserializer for console applications? VS 2019:构建 Docker 映像在运行 dotnet restore 时抛出异常 - VS 2019 : Build Docker image throw Exception at Run dotnet restore 当我运行 dotnet run 时,为什么 dotnet restore 命令会在后台运行? - Why the dotnet restore command run behind the scenes when I run dotnet run? 我得到“构建失败”。 我在 Package 管理器控制台上写的任何东西都出错,没有任何其他解释 - I get "Build failed." error for anything I write on Package Manager Console without any other explanation Dotnet还原在生成服务器上失败 - Dotnet Restore Failed on Build Server 我可以使用 dotnet publish 命令来构建 .NET Framework 应用程序吗? - Can I use dotnet publish command to build .NET Framework applications? Nuget/Dotnet package 管理器 - 我如何检索 $(<somevariable> )</somevariable> - Nuget/Dotnet package manager - how can I retrieve $(<SomeVariable>) 我在 do.net 平台上运行代码有问题 - I have a problem with run code on platform dotnet 实体框架程序包管理器控制台命令错误-生成失败 - Entity Framework Package Manager Console Commands Error - failed to build 从visual studio命令提示符运行nuget包管理器控制台 - Run nuget package manager console from visual studio command prompt
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM