muhammad
muhammad
CC#
Created by muhammad on 6/7/2023 in #help
❔ 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>
2 replies