如何在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.

posted @ 2019-11-03 02:24  麦壳饼  阅读(157)  评论(0编辑  收藏  举报