visual studio 2019 .csproj install latest NuGet version

Viewed 156

I have a very simple VS2019 .csproj file which can be seen below:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
  </PropertyGroup>

    <ItemGroup>
        <PackageReference Include="AST.NxTestware.main" Version="1.0.0" />
    </ItemGroup>

</Project>

When I save the csproj file, I can see in my right hand side the dependency is downloaded, and I can find the installed NuGet package on my PC enter image description here

Under the manage nuget package window I can see a newer version 1.1.0 enter image description here

I want to edit my .csproj file so that it always installs the most recent NuGet package version, and I tried doing so by setting version="*" https://docs.microsoft.com/en-us/nuget/concepts/package-versioning

but setting version=* causes my VS2019 dependency list to show a yellow warning circle now which wont go away, and if I check my local NuGet installation folder I can see that nothing got installed

enter image description here

How can I tell VS2019 to automatically install the latest version of my NuGet package?

1 Answers

According to your description, I did some tests related to your problem, but could not reproduce your problem. You can try these suggestions and let me know if it doesn't work.

  1. You can go to Tools>Options>NuGet Package Manager to Clear All NuGet Caches. Add this in your .csproj file “” and rebuild the project. enter image description here
  2. You can change a package source to check if other packages can use Version=”*”.
  3. Please let me know If you get any update about the issue.
Related