Reputation: 1163
I'm using floating point dependencies for my other projects like below:
<PackageReference Include="Farayan.NETCommonSuper" Version="1.0.*" />
Version 1.0.*
means latest version of Farayan.NETCommonSuper
that starts with 1.0.
, but visual studio does not check for latest version on every build.
Imagine I updated module Farayan.NETCommonSuper
that I need to get reflected into my another module (let's name it depend module
), currently I need to open Manage nuget packages
context menu, and update dependency by myself, which removes * version and fix it in .csproj file, then open that .csproj file to revert it back.
Is there any settings or config or script to force vs to check for latest version of a star-versioned dependency?
Upvotes: 4
Views: 2056
Reputation: 23808
I agree with zivkan. However, VS IDE detects the float version of the nuget dependency automatically.
To add more detail
Version 1.0.* means latest version of Farayan.NETCommonSuper that starts with 1.0., but visual studio does not check for latest version on every build.
Please if you have enabled the two options under Tools-->Options
Also, you could try this to make a automatic script:
Right-click on your project on the Solution Explorer-->Properties-->Build Event-->
add like this this under Pre-build event command line:
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe" -t:restore -p:RestoreForceEvaluate=true
Click Build button and you can get that you want.
Upvotes: 0
Reputation: 15071
Right click the solution in Solution Explorer, and select "Restore NuGet Packages"
dotnet restore --force-evaluate
msbuild -t:restore -p:RestoreForceEvaluate=true
nuget.exe restore -ForceEvaluate
Upvotes: 3