What is AssemblyInfo.cs used for?

Go to your Project Properties, the Application tab, and click the Assembly Information button.

That's what is stored in AssemblyInfo.cs.

In Windows Explorer, right click your project's .exe output, select Properties, and go to the Details tab. That is the information generated by AssemblyInfo.cs.


AssemblyInfo.cs contains information about your assembly, like name, description, version, etc. You can find more details about its content reading the comments that are included in it.

If you delete it, your assembly will be compiled with no information, i.e., in the Details tab of the file properties you will see no name, no description, version 0.0.0.0, etc.

The value associated with assembly:Guid is the ID that will identify the assembly if it will be exposed as a COM object. So, if your assembly isn't COM-exposed, you don't need this. It is randomly generate. In any case, normally, you don't need to modify it.

Credits goes to : http://social.msdn.microsoft.com/Forums/en/csharpgeneral/thread/8955449f-71ac-448e-9ee6-5329fceecd3c


In AssemblyInfo file you can store informations which you can get from every place in the project, so you don't have to update all the places but just the assemblyInfo.

For example - in this file you update the version number, and it is updated automatically in your site. In the html page, to get the version number, write:

Assembly assembly = Assembly.GetAssembly(typeof(ProjectName.WebSite.Controllers.MyController));
string version = assembly.GetName().Version.ToString();

and it will be updated each time you upload a new version.


In AssemblyInfo file Informational Attributes contains the information about product Name, description, Trademark, copyright. In general this information's are either hardcode or store in database or flat file. .NET assembly provides to store this information in AssemblyInfo file and after compilation it becomes the part of assembly. So at run time one can read this information.

Part of Assembly Information

1 AssemblyTitle : Title name from the assembly.

2 AssemblyDescription: It provides the detail description from the assembly.

3 AssemblyCompany: It Provides the company information from the assembly.

4 AssemblyProduct: It provides the production information from the assembly.

5 AssemblyCopyright: It Provides the copyright from the assembly.

6 AssemblyTrademark: It Provides the trademark from the assembly.

Each of these attributes has a defined class, which is used to read the information from the AssemblyInfo file.

From: https://www.dotnetspider.com/forum/157292-assemblyinfo-file.aspx

Tags:

.Net