Home > OS >  How to manually execute 'restore' on a C# function project in visual studio code?
How to manually execute 'restore' on a C# function project in visual studio code?

Time:11-18

In Visual Studio Code my Azure Function project periodically displays a popup asking me to 'restore' the project. It seems to update the libraries and/or connect them to my code. If I click the button restore usually functions to fix the errors.

One of my projects suggests performing a restore, however no popup. How do I manually trigger a restore?

CodePudding user response:

dotnet restore. Here's microsoft's documentation.

What this command does is to restore any dependencies: nuget packages, project references and tools for your project/solution, based upon your configuration and current directory (running in a directory with a .sln will restore anything referenced in the solution for example)

It's a prerequisite for all other compilation-related commands, such as build, test or publish.

Usually an IDE like Visual Studio will perform this in the background. A VSCode extension on the other hand, depending on your settings, might always ask before.

  • Related