[C #] Analyzing AssemblyInfo. cs,
Analysis of AssemblyInfo. cs-learn about common Attribute
[Blogger] Anti-bone Aberdeen [original] http://www.cnblogs.com/liqingwen/p/5944391.html
Collation
Last time, we used "C # knowledge Review-feature Attribute" to learn how to create and use feature attributes. This time, let's take a look at the AssemblyInfo file that comes with every time VS is used to create a project. cs.
Directory
Core code
Show the code in the diagram and check the Arrow
Using System. Reflection; using System. Runtime. InteropServices; // The general information about the assembly is controlled through the following feature set. Modify these feature values to modify // information associated with the Assembly. [Assembly: AssemblyTitle ("MusicStore")] [assembly: AssemblyDescription ("")] [assembly: AssemblyConfiguration ("")] [assembly: AssemblyCompany ("Microsoft")] [assembly: AssemblyProduct ("MusicStore")] [assembly: AssemblyCopyright ("Copyright©Microsoft 2016 ")] [assembly: AssemblyTrademark (" ")] [assembly: AssemblyCulture (" ")] // setting ComVisible to false will make the type in this Assembly invisible to the COM component. If you need to // access a type in this Assembly from COM, set the ComVisible attribute to true for this type. [Assembly: ComVisible (false)] // if this item is made public to COM, the following GUID is used for the ID of typelib [assembly: Guid ("a9ef3281-9049-4a52-a2f1-2061d442200e")] // The Assembly version information consists of the following four values: // main version/secondary version/internal version/revision version // All values can be specified, you can also use the default values of revision number and internal version number to use "*": [assembly: AssemblyVersion ("1.0.0.0")] [assembly: assemblyFileVersion ("1.0.0.0")]
I. Global attributes
Most features apply to specific language elements (such as classes or methods), but some attributes apply globally to the entire assembly or module. For example, the AssemblyVersionAttribute can be used to embed version information into the assembly.
Global features appear in any top-levelusingCommand and any type, module, or namespace declaration. The global feature can be displayed in multiple source files, but files must be compiled during a single compilation. In the C # project, they are in the AssemblyInfo. cs file.
The Assembly feature is the value that provides information about the assembly. They are divided into the following categories:
① Assembly identity feature
② Information Features
③ Assembly list features
④ Strong name features
1. Assembly identity features
The three features (Strong names, if applicable) determine the Assembly identifier: name, version, and culture. When cited in code, these features constitute the complete name of the Assembly. You can set the version and culture of an assembly. However, the name value is set by the compiler in Visual Studio IDE of the "assembly information" dialog box. After an assembly is created, the name value is based on the file that contains the Assembly List. The assemblyflagsattri attribute specifies whether multiple copies of an assembly can coexist.
Figure-"assembly information" dialog box
Figure- ing between nouns and AssemblyInfo. cs files in the "assembly information" dialog box
2. Information Features
You can use the information feature to provide other company or product information for the Assembly.
3. assembly list features
You can use the Assembly list feature to provide information in the assembly list. This includes the title, description, default alias, and configuration.
[Reference] Microsoft official documentation