.NET Framework Bookmark and Share   
 index > MSBuild > Where to set Assembly Version? when -> Using MSBuild to compile & merge an Asp.Net Application
 

Where to set Assembly Version? when -> Using MSBuild to compile & merge an Asp.Net Application

Hi, When I look at the merged assembly of an Asp.Net application the version of the dll is 0.0.0,
How do I configure the build script to set an assembly version or auto-increment one?

<?xml version="1.0" encoding="utf-8"?>

<Project DefaultTargets="MergeWebSite" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <PropertyGroup>
    <PhysicalPath>C:\DEMO\DemoWebSite\DemoWebSite</PhysicalPath>
    <TargetPath>C:\DEMO\DemoWebSite_Precompiled</TargetPath>
    <VirtualPath>DemoWebSite</VirtualPath>
    <Force>true</Force>
    <Debug>false</Debug>
    <AssemblyName>DemoWebSite</AssemblyName>
    <ApplicationVersion>1.0.1.0</ApplicationVersion> 
  </PropertyGroup>

  <Target Name="CompileWebSite">
    <Message Text="Compiling $(VirtualPath)" />
    <AspNetCompiler
			PhysicalPath="$(PhysicalPath)"
			TargetPath="$(TargetPath)"
			VirtualPath="$(VirtualPath)"
			Force="$(Force)"
			Debug="$(Debug)"
      />
  </Target>

  <Target Name="MergeWebSite" DependsOnTargets ="CompileWebSite">
    <Message Text="Merging compiled site" />
    <Exec Command='aspnet_merge.exe "$(TargetPath)" -o $(AssemblyName)'
          WorkingDirectory="C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin"
          />
  </Target>
</Project>

I.W Coetzer
I.W Coetzer

Hi, Coetzer
Please read this artical by BradleyB, this artical illustrate how to make the application version auto-increment.
How to auto-increment assembly version using a custom MSBuild task
Hope this could help!
Thanks

Chao Kuo

Hi, Coetzer
Please read this artical by BradleyB, this artical illustrate how to make the application version auto-increment.
How to auto-increment assembly version using a custom MSBuild task
Hope this could help!
Thanks

Chao Kuo

You can use google to search for other answers

Custom Search

More Threads

• touch task
• MSBuild unable to compile a project in a solution file, if project name contain dot "."
• VS 2003 devenv.exe as a scheduled task hangs during clean step after vs2005 install
• concatenate datestamp to logfile name
• "CompilationOptions" parameter is not supported by the "CompileWorkflowTask" task
• Display All Properties
• ZipProject for Extensibility Web Templates
• Custom task for EVC?
• Output's PropertyName doesn't propagate to child targets!?
• Says "This project is out of date" every time!!