What is AssemblyInfo.cs used for?
.Net.Net Problem Overview
My question is pretty basic. What I'd like to know is what is the AssemblyInfo.cs
file used for?
.Net Solutions
Solution 1 - .Net
> 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
Solution 2 - .Net
> 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
Solution 3 - .Net
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.
Solution 4 - .Net
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.
Solution 5 - .Net
It is a convenient location for assembly level attributes, such as the version, company name etc.
Solution 6 - .Net
AssemblyInfo.cs contains general information about the application you are building, some of these information includes the title of your application, copyright etc, for instance if the title of your application is "MyApplication" you should see something like this: [assembly: AssemblyTitle("MyApplication")]