Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can use the <a href="https://github.com/loresoft/msbuildtasks/downloads" rel="nofollow">MsbuildCommunityTasks</a> to generate the build number and to customize the assembly file version on pre-build time.</p> <ul> <li><p>Download the zip at <a href="https://github.com/loresoft/msbuildtasks/downloads" rel="nofollow">MsbuildCommunityTasks</a></p></li> <li><p>Unzip to the folder [SolutionFolder]\MsBuildExtensions\MSBuildCommunityTasks </p></li> <li><p>Add the sample below on your project (csproj), just after the Microsoft.CSharp.Targets import.</p></li> </ul> <p> </p> <pre><code> &lt;PropertyGroup&gt; &lt;MSBuildCommunityTasksPath&gt;$(MSBuildThisFileDirectory)..\MsBuildExtensions\MSBuildCommunityTasks&lt;/MSBuildCommunityTasksPath&gt; &lt;My-PropertiesDir&gt;Properties&lt;/My-PropertiesDir&gt; &lt;/PropertyGroup&gt; &lt;Import Project="$(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.Targets"/&gt; &lt;Target Name="BeforeBuild"&gt; &lt;Time Format="yyyy.MM.dd.HHmm"&gt; &lt;Output TaskParameter="FormattedTime" PropertyName="My-VersionNumber" /&gt; &lt;/Time&gt; &lt;Message Text="Building $(My-VersionNumber) ..."&gt; &lt;/Message&gt; &lt;ItemGroup&gt; &lt;My-AssemblyInfo Include="$(My-PropertiesDir)\AssemblyVersionInfo.cs" /&gt; &lt;Compile Include="@(My-AssemblyInfo)" /&gt; &lt;/ItemGroup&gt; &lt;MakeDir Directories="$(My-PropertiesDir)" /&gt; &lt;AssemblyInfo OutputFile="@(My-AssemblyInfo)" CodeLanguage="CS" AssemblyFileVersion="$(My-VersionNumber)" AssemblyInformationalVersion="$(My-VersionNumber)" Condition="$(My-VersionNumber) != '' " /&gt; &lt;/Target&gt; &lt;Target Name="AfterBuild"&gt; &lt;Delete Files="@(My-AssemblyInfo)" /&gt; &lt;/Target&gt; </code></pre> <p> </p> <ul> <li><p>Wipe the AssemblyFileVersion attribute from your AssemblyInfo.cs. It will be generated at build time. </p></li> <li><p>You'll see the version number being printed on the console when you build. The generated file is deleted on the AfterBuild target, to keep your source control clean.</p> <p><em>BeforeBuild:</em></p> <p>Building 2013.01.14.1016 ... Created AssemblyInfo file "Properties\AssemblyVersionInfo.cs".</p> <p>(...)</p> <p><em>AfterBuild:</em></p> <p>Deleting file "Properties\AssemblyVersionInfo.cs".</p></li> <li><p>If you want do this to many projects with less msbuild code, it will be necessary to create a customized build script to wrap up your solution.</p></li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload