Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting the default values of AssemblyInfo.cs

Tags:

c#

What is the best way to change the default values that AssemblyInfo.cs is created with, e.g. I don't want the Microsoft bits in AssemblyCompany and AssemblyCopyright

[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2011")]
like image 976
SteveC Avatar asked Sep 19 '11 08:09

SteveC


People also ask

What are the contents of 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.

What generates AssemblyInfo CS?

You can generate an assemblyInfo. cs by right clicking the project and chosing properties. In the application tab fill in the details and press save, this will generate the assemblyInfo.

Where is the AssemblyInfo CS?

AssemblyInfo. cs is in the properties folder of the Project.

What is the difference between AssemblyVersion and AssemblyFileVersion?

AssemblyVersion: Specifies the version of the assembly being attributed. AssemblyFileVersion: Instructs a compiler to use a specific version number for the Win32 file version resource.


2 Answers

It appears that this info is embedded in the project template definition. For instance, if I create a project using the "Console Application" project template, it uses:

C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplates\CSharp\Windows\1033\ConsoleApplication.zip

Looking inside that zip file there is an AssemblyInfo.cs file which contains:

[assembly: AssemblyCompany("$registeredorganization$")]
[assembly: AssemblyProduct("$projectname$")]
[assembly: AssemblyCopyright("Copyright © $registeredorganization$ $year$")]

So if you can't change the registration info of your machine like others have suggested, you could just update this file here

like image 84
Amit G Avatar answered Oct 02 '22 15:10

Amit G


Probably only in registry:

32 bit: HKLM\Software\Microsoft\Windows NT\CurrentVersion
64 bit: HKLM\Software\Wow6432Node\Microsoft\WindowsNT\CurrentVersion

Changing the default values for AssemblyInfo.cs

Also here is the post on SO: How to change registration company name for Visual Studio 2008?

like image 34
Samich Avatar answered Oct 02 '22 17:10

Samich