MSBump icon indicating copy to clipboard operation
MSBump copied to clipboard

csproj file settings always use the 'Debug' configuration even on Release builds

Open mramsey161 opened this issue 5 years ago • 2 comments

I have an issue with the build configuration conditional checks not being respected:

1.0.1.0 True 1.0.1.0 True

Should be pretty straightforward but when I switch between Debug and Release builds in VS2017 or using "dotnet build -c Release" its only ever the version for Debug that's incremented.

Am I doing something wrong ?

And a great tool by the way I've been struggling to get incremented versions in Docker containers for OpenShift deployments.

mramsey161 avatar Jun 26 '19 12:06 mramsey161

Sorry, code not displaying correctly <PropertyGroup Condition="'$(Configuration)'=='Debug'"> <Version>1.0.1.0</Version> <BumpRevision>True</BumpRevision> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)'=='Release'"> <Version>1.0.1.0</Version> <BumpRevision>True</BumpRevision> </PropertyGroup>

mramsey161 avatar Jun 26 '19 12:06 mramsey161

Hi, unfortunately MSBump rewrites the first Version tag inside the first PropertyGroup. It has no concept of conditionals or other MSBuild features. When choosing the configuration to use, it just reads the Configuration property from the project, but otherwise performs no processing on the file.

BalassaMarton avatar Jun 27 '19 11:06 BalassaMarton