2

I had a problem where I received the error: Nuget error when trying to build my applications. I found a solution here The solution was to run dotnet restore through the Package Manager Console. 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

Is there something I can change so I don't have to run dotnet restore before every build.

Edit: added what I was looking for

Meh Peh
  • 21
  • 3
  • 1
    If you have multiple projects, you can right click the solution -> Restore Nuget Packages. – denys-vega Jul 20 '20 at 19:21
  • 3
    Can you help us to answer your questions by including a question? Do you want Visual Studio to automatically restore things? Do you want to find a point-and-click way of restoring things? What's your end goal? – omajid Jul 20 '20 at 19:25
  • @omajid Yes ofcourse I added my end goal. I'm looking for a solution so I don't have to run dotnet before every build. – Meh Peh Jul 20 '20 at 20:48

1 Answers1

1

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.

The fix was to delete the file projects.assets.json, and after that it compiled successfully.

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574