I am using the GitInfo nuget package from https://github.com/kzu/GitInfo to provide branch and commit information within my web application.
I have a publish profile set up to deploy to the filesystem and I'd like to include the git branch name in the path. I tried changing this line in the pubxml file:
<publishUrl>C:\Development\Web\Publish_$(GitBranch)</publishUrl>
...however the '$(GitBranch)' was ignored (website was successfully published to 'Publish_' folder). I am publishing using the 'Publish...' wizard in Visual Studio 2015.
My website vbproj file has the following imports and targets:
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PreBuildEvent />
<PostBuildEvent />
</PropertyGroup>
<Import Project="packages\GitInfo.2.0.3\build\GitInfo.targets" Condition="Exists('packages\GitInfo.2.0.3\build\GitInfo.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('packages\GitInfo.2.0.3\build\GitInfo.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\GitInfo.2.0.3\build\GitInfo.targets'))" />
</Target>
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(MSBuildToolsVersion)\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
Is what I want to do possible?