Install NuGet packages in Visual Studio Code
Install NuGet packages by using the NuGet Gallery extension.
Set Visual Studio Code as the default external code editor. See Set the default code editor.
- From the main toolbar, selectOpen .NET Solution.The default external code editor opens.TIP: We recommend using Microsoft Visual Studio 2022 or Microsoft Visual Studio Code as the default code editor. Some development assistance features may not be available when using a different code editor.
- In Visual Studio Code, install the NuGet Gallery extension NuGet Gallery - Visual Studio Marketplace.
- Open theCommand Paletteby pressing .
- In theCommand Palette, enternugetand selectNuGet: Open NuGet Gallery.
- Install the necessary NuGet packages.
- In theCSPROJfile, after the<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>property, add the<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>property.
- Save theCSPROJfile.
- Compile the project.
Provide Feedback