简体   繁体   中英

Help with Assembly Information File in C#

什么是C#中的程序集信息文件以及如何使用它?

The AssemblyInfo file is used to document your dlls or exes to describe where the code comes from, its version etc. If your code is publicly available then its certainly good practice to make sure you add useful information too it. http://www.codinghorror.com/blog/archives/000141.html

If you build your project with NAnt there is also a useful target that allows you to build the assembly info dynamically. http://nant.sourceforge.net/release/latest/help/tasks/asminfo.html

Right-click on any program icon, and select 'Properties'. Navigate to the 'Version' tab. That information you see is what is contained in the AssemblyInfo.cs file, among other things.

It holds information about your assembly. Author, Company, Version Numbers (build/minor/major/etc)

Try this article:

http://msdn.microsoft.com/en-us/library/1h52t681.aspx

It's a file created by the default project templates under the "Properties" folder that has attributes defined at the assembly-level that the C# compiler and framework use to store various bits of metadata like the title of the assembly, the version, the publisher, etc. There's other framework-specific attributes that you can throw in there such as XAML namespaces, Data Contract namespaces, etc. Basically any attributes that you define at the assembly level are typically placed in here.

There's nothing special about the name though. These attributes can actually appear anywhere in any code file.

I posted a neat little tip about dealing with the issue of having multiple AssemblyInfo files in different projects in a solution that all have common attributes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM