문제

The Version class in .NET represents version numbers as consisting of two to four components. AssemblyInfo files specify the following format for the AssemblyVersion and AssemblyFileVersion fileds:

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version 
//      Build Number
//      Revision

It is unclear if Build Number and Revision are required here, since they aren't required in the Version class. Are they required? In other words, is this legal?

[assembly: AssemblyVersion("1.0")]
[assembly: AssemblyFileVersion("1.0")]

Or does that need to be represented as the following?

[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
도움이 되었습니까?

해결책

It appears that the AssemblyVersion may be in a variety of forms:

Examples of valid version strings include:
1
1.1
1.1.*
1.1.1
1.1.1.*
1.1.1.1

But AssemblyFileVersion must be of the form major.minor.build.revision:

The file version is normally a string of four numbers, separated by periods, reflecting the major version number, minor version number, build number, and revision number; for example, "1.0.4309.00". If version is not in this format, a compiler warning occurs, and the results displayed in the file properties dialog are unpredictable. Wildcards are not supported.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top