如何在ClickOnce 应用中使用 GitVersion

Posted mysticboy

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了如何在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.

以上是关于如何在ClickOnce 应用中使用 GitVersion的主要内容,如果未能解决你的问题,请参考以下文章