❔ How can I get version of installed Nuget package in .csprog file in visual studio.
0
I am using conditional compilation and in the condition I need to compare the installed version of a specific Nuget package with the given version. Can this be done inside .csprog file?
<ItemGroup>
<PackageReference Include="MyPackages.AlphaPackage" Version="2.0.1" />
</ItemGroup>
<PropertyGroup Condition="True"> <!-- Here I want to check if Version of MyPackages.AlphaPackage is 2.0.1 -->
<DefineConstants>Version2Installled</DefineConstants>
</PropertyGroup>
1 Reply
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.