Install NuGet packages in Visual Studio

Install NuGet packages by using NuGet Packages Manager.
Set Visual Studio as the default external code editor. See Set the default code editor.
  1. From the main toolbar, select
    Open .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.
  2. Select the project to open the
    CSPROJ
    file.
  3. In the
    CSPROJ
    file, after the
    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
    property, add the
    <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
    property.
  4. Save the
    CSPROJ
    file.
  5. Compile the project.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.