msbuild を呼び出す Visual Studio 2008 でビルド前のタスクを使用しています。
C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe $(MSBuildProjectDirectory)\version.targets /p:Configuration=$(ConfigurationName)
version.targets 内で、AssemblyInfo.cs ファイルを更新してバージョン情報を置き換えています。
<FileUpdate
Encoding="ASCII"
Files="$(MSBuildProjectDirectory)\Properties\AssemblyInfo.cs"
Regex="AssemblyInformationalVersion\(".*"\)\]"
ReplacementText="AssemblyInformationalVersion("Product $(ConfigurationString) ($(buildDate))")]"
/>
Visual Studio 2008 でプロジェクトをビルドすると、問題なくビルドされます。
しかし、結果のexeのバージョン情報を見ると、AssemblyInfo.csが「正しい」ものに変更されていても、以前のタイムスタンプが含まれています。
ビルド前の変更はメインのコンパイル タスクでは認識されず、常に 1 つ遅れているようです。
私が間違っていることのアイデアはありますか?