Binding hudson build number in C# project
Is there a way to bind the hudson successful build's number in the C# WPF 开发者_运维问答application? Meaning, on running the exe after building I want to show the build number say 10 in my application somewhere. In project configuration file, I have used ${BUILD_NUMBER}, that a hudson understands and creates a build with the revision number. If I build the Project revision # 10, I get 10.exe. Can I have something that will show this number somewhere in my application? Hope I am clear. Please help.
I'm not sure what Hudson is, but MSBUILD can do this. See this link
You should use the AssemblyInfo Task, which is part of the MSBuild Community Tasks library to update the AssemblyInfo.cs file for your project.
<AssemblyInfo
CodeLanguage="CS"
OutputFile="MyApplication\Properties\AssemblyInfo.cs"
AssemblyVersion="@(VersionMajor).@(VersionMinor).@(VersionBuild).@(VersionRevision)"
AssemblyFileVersion="@(VersionMajor).@(VersionMinor).@(VersionBuild).@(VersionRevision)"
/>
精彩评论