如何在ClickOnce 应用中使用 GitVersion

https://github.com/GitTools/GitVersion/issues/1153

I'm using GitVersion in an internal ClickOnce application. It's quite easy to setup. I've added following target in my .csproj file:

<Target Name="MyApp_SetClickOnceVersion" AfterTargets="UpdateAssemblyInfo" DependsOnTargets="GetVersion" BeforeTargets="_DeploymentComputeClickOnceManifestInfo"> <CreateProperty Value="$(GitVersion_AssemblySemVer)"> <Output TaskParameter="Value" PropertyName="ApplicationVersion" /> </CreateProperty> <!-- for VSTO --> <CreateProperty Value="$(ApplicationVersion)"> <Output TaskParameter="Value" PropertyName="PublishVersion" /> </CreateProperty> <Message Text="ApplicationVersion: $(ApplicationVersion)" Importance="High" /> </Target>

This will set the properties ApplicationVersion and PublishVersion dynamically to the correct value.

猜你喜欢

转载自www.cnblogs.com/MysticBoy/p/11785036.html