From Visual Studio.net 2003 to 2010

I shall start the journey by using Visual Studio.net 2003 before looking at migrating to VS.net 2005, Vs.net 2008 and Vs.net 2010.

My environment is Windows Professional XP installed on a XP Virtual Machine on a Dell Inspiron 14R powered by Windows 7-64 bits.

Microsoft SQL Express 2008/R2 serves as the database server

Friday, February 10, 2012

What is AssemblyInfo.cs ?

AssemblyInfo.cs file is created automatically when you create a windows application by VS in the same folder as Global.asax and web.config and "Properties" folder by VS 2005. It also get created, when you create any Web Application project. It does not create for Website project in Visual Studio.

It contains the version information that will go into your app or assembly - things like the company name, copyright notices etc., and the assembly version number, of course.

You can inspect those values in Windows Explorer by right-clicking on an .EXE or .DLL, go to "Properties", and then go to the "Version" tab - those pieces of info in there come from whatever you fill into "AssemblyInfo.cs" in your project.

Solution with Multiple Projects

Visual Studio creates an AssemblyInfo.cs file for each project in a solution in a 'Properties' folder. However, more often than not, I'm more interested in an application's version than the individual assembly's version, and the solution is the application. So I find that each time I create a solution with multiple projects (assemblies) I add a 'Common' project that has an AssemblyInfo.cs file to be used by all other projects. That way all assemblies have the same version information.

To do this delete the AssemblyInfo.cs file in each project and then 'Add Existing item' browse to the common AssemblyInfo.cs and add as link. This way all projects share the same

AssemblyInfo.cs file. Unfortunately Visual Studio does not allow adding any items to the 'Properties' folder.

See also

.Net Tips — use a shared AssemblyInfo.cs for your solution

No comments:

Post a Comment