2016-05-24 3 views
0

質問AssemblyInfo.cs

にバージョンとbuild.numberを初期化する方法を、私はAssemblyInfo.csファイルからバージョンを読んで、チームシティーで%build.number%としてそれを設定することができますか?

詳細

基本的に私は、この例ではバージョン(2.2.0)を読みたい:

// Setting ComVisible to false makes the types in this assembly not visible 
// to COM components. If you need to access a type in this assembly from 
// COM, set the ComVisible attribute to true on that type. 
[assembly: ComVisible(false)] 

// The following GUID is for the ID of the typelib if this project is exposed to COM 
[assembly: Guid("97f3f431-69a7-48c2-8bf8-7ae29075b72e")] 

// Version information for an assembly consists of the following four values: 
// 
//  Major Version 
//  Minor Version 
//  Build Number 
//  Revision 
// 
// You can specify all the values or you can default the Build and Revision Numbers 
// by using the '*' as shown below: 
// [assembly: AssemblyVersion("1.0.*")] 
[assembly: AssemblyVersion("2.2.0")] 
[assembly: AssemblyFileVersion("2.2.0")] 
[assembly: NeutralResourcesLanguage("en-US")] 

とチームシティープロジェクトでの私の%build.number%

+3

私はそうではありませんでしたが、私の推測では、研究の証拠が不足しています。私はGoogleに質問を貼り付け、ヒットをたくさんしました。なぜあなたのために働くのですか? –

+1

@CharlesMagerほとんどのオンラインリソースは、AssemblyInfoバージョンの置き換え方法を示しています。私はこのバージョンを読んで、チームシティーの定義済みの%build.number%変数として設定する必要があります。 –

+0

@CharlesMagerありがとうございました。 –

答えて

1

なぜとしてそれを使用しますあなたはそれをしたいですか?一般的に、この要求は逆の方向、すなわち%build.number%~AssemblyVersionAssemblyInfo.csに設定することができる。 AssemblyInfo Patcher

+0

[ファイルコンテンツの置換え| https://confluence.jetbrains.com/display/TCD9/File+Content+Replacer]機能も使用できます。この機能はTeamCity 9.1以降で使用でき、AssemblyInfo Patcherの拡張バージョンです。 –

-1

ビルド番号は、アセンブリのバージョン期間と常に一致している必要があります。 これで、プロダクションでどのようにビルドしたビルドになりましたか。

関連する問題