views:

86

answers:

4

What is the Assembly Information File for in C# and how do I use it?

+1  A: 

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

Joel Etherton
+1  A: 

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.

Charlie Salts
+1  A: 

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.

Josh Einstein
+2  A: 

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

Jon Palmer