How to restore nuget package with devenv.exe

Preethi Ravi 30 Reputation points
2024-02-06T07:26:04.85+00:00

I have an msi installer with some nuget packages used. I want to build this using devenv. I am using the below command but it fails since it is not restoring nuget package. Furthermore I am not using msbuild since it does not support vdproj. devenv ACustomerApp.sln /rebuild "Release|Any Cpu" How to restore nuget package with devenv?

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,438 questions
{count} votes

Accepted answer
  1. walitalokar 80 Reputation points
    2024-02-07T17:39:59.69+00:00

    Use nuget.exe before devenv: Download and install the standalone nuget.exe tool from the official NuGet website: https://www.nuget.org/downloads: https://www.nuget.org/downloads. Open a command prompt and navigate to your solution directory. Run the following command to restore NuGet packages: nuget restore ACustomerApp.sln Once the packages are restored, you can use your original devenv command to build the solution: devenv ACustomerApp.sln /rebuild "Release|Any Cpu"


0 additional answers

Sort by: Most helpful