這裏就是我的AssemblyInfo.cs版本字符串看起來像預編譯:TeamCity的集信息修補補丁文件,但DLL版本是不是「正確」
[assembly: AssemblyVersion("2.0.0920.10")]
[assembly: AssemblyFileVersion("2.0.0920.10")]
在生成,修補器做什麼,我想,修改文件:
[assembly: AssemblyVersion("2.0.0.1146")]
[assembly: AssemblyFileVersion("2.0.0.1146")]
但在構建過程中的某一點也做到這一點:當BUIL
[assembly: AssemblyVersion("2.0.0921.00")]
[assembly: AssemblyFileVersion("2.0.0921.00")]
然後d完成後,它看起來像這樣再次:
[assembly: AssemblyVersion("2.0.0920.10")]
[assembly: AssemblyFileVersion("2.0.0920.10")]
當我用鼠標右鍵單擊Windows資源管理器生成的DLL,命中屬性,然後轉到細節選項卡,文件版本「2.0.921.0」和產品版本「2.0.921.00」。
我還獲得「2.0.921.0」與Assembly.GetExecutingAssembly().GetName().Version.ToString()
我的構建具有2個生成步驟,一個是與解決方案構建,另一個是一個命令行的步驟,只是複製的DLL來開發服務器。
我不想粘貼整個生成日誌,因爲它是大的,但這裏有我的想法是亮點:
[14:24:54]: Step 1/2: Visual Studio 2010 Build (Visual Studio (sln)) (27s)
[14:24:54]: [Step 1/2] Update assembly versions: scanning checkout directory for AssemlyInfo files to update version
[14:24:54]: [Update assembly versions] ... for all of our assemblies
[14:24:55]: [Step 1/2] Starting: C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.MsBuildBootstrap.exe /workdir:C:\TeamCity\buildAgent\work\677e8e784c19cc26 /msbuildPath:C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
[14:24:55]: [Step 1/2] in directory: C:\TeamCity\buildAgent\work\677e8e784c19cc26
[14:25:01]: [Step 1/2] main\solution.sln: Build target: Rebuild (20s)
[14:25:01]: [main\solution.sln] ValidateSolutionConfiguration
[14:25:01]: [ValidateSolutionConfiguration] Building solution configuration "Release|Mixed Platforms".
[14:25:02]: [Step 1/2] main\SolutionDir\solution.csproj: Build target: Rebuild (7s)
...
[14:25:21]: [Step 1/2] Process exited with code 0
[14:25:21]: Step 2/2: Copy Dlls and Templates to Sohodev (Command Line) (3s)
[14:25:21]: [Step 2/2] "BuildAndCopyDllsAndTemplatesv2.cmd" is not present in directory C:\TeamCity\buildAgent\work\677e8e784c19cc26
[14:25:21]: [Step 2/2] Starting: C:\Windows\system32\cmd.exe /c BuildAndCopyDllsAndTemplatesv2.cmd
[14:25:21]: [Step 2/2] in directory: C:\Scripts\Build
[14:25:21]: [Step 2/2] 1 file(s) copied.
[14:25:21]: [Step 2/2] 1 file(s) copied.
[14:25:24]: [Step 2/2] Process exited with code 0
[14:25:24]: Reverting patched assembly versions
[14:25:24]: [Reverting patched assembly versions] Restoring ... for all of our assemblies
[14:25:24]: Publishing internal artifacts (2s)
[14:25:27]: [Publishing internal artifacts] Sending build.finish.properties file
[14:25:27]: Build finished
編輯 我們TeamCity的版本號:6.5.1(建17834)
編輯 我剛升級到6.5.4(build 18046)。行爲沒有變化。