.Net 2.0 を使用しており、アセンブリからバージョン情報を取得しています。理想的ではないかもしれませんが、説明を使用してビルド日を保存します。
Assembly assembly = Assembly.GetExecutingAssembly();
string version = assembly.GetName().Version.ToString();
string buildDate = ((AssemblyDescriptionAttribute)Attribute.GetCustomAttribute(
assembly, typeof(AssemblyDescriptionAttribute))).Description;
ビルド プロセスは asminfo nant タスクを使用して、この情報を含む AssemblyInfo.cs ファイルを生成します。
<asminfo output="Properties\AssemblyInfo.cs" language="CSharp">
<imports>
<import namespace="System" />
<import namespace="System.Reflection" />
<import namespace="System.Runtime.CompilerServices" />
<import namespace="System.Runtime.InteropServices" />
</imports>
<attributes>
<attribute type="AssemblyVersionAttribute" value="${assembly.version}" />
<attribute type="AssemblyInformationalVersionAttribute" value="${assembly.version}" />
<attribute type="AssemblyDescriptionAttribute" value="${datetime::now()}" />
...
</attributes>
</asminfo>