SteveC
SteveC

Reputation: 16733

Setting the default values of AssemblyInfo.cs

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")]

Upvotes: 15

Views: 9709

Answers (5)

Steve
Steve

Reputation: 549

As an update, I found this location and updated all the assemblyinfo.cs files for the various project types (Visual Studio 2015, Windows 10). That seems to have worked:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\ProjectTemplates\CSharp\Windows Root\Windows\1033

Upvotes: 0

Samich
Samich

Reputation: 30095

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?

Upvotes: 13

Jowen
Jowen

Reputation: 5383

Little offtopic: Every project has its own assemblyinfo.cs. To keep things DRY, I'd recommend the usage of a GlobalAssemblyInfo

Upvotes: 3

Amit G
Amit G

Reputation: 5475

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

Upvotes: 12

Darren Lewis
Darren Lewis

Reputation: 8488

If you mean when you create a new VS Project it should default to your firm name, you can modify the project templates but this will need to be done on each dev machine.

If you're trying to alleviate the PITA of managing this common data in all of the assemblies in a solution you could use a SharedAssemblyInfo.cs file. Create this at the solution level then add to all of your other projects by adding it as a linked file (the Add Dialog box has a little flyout on the button). This approach is used commonly for assembly versioning

More info from this SO post also.

Upvotes: 0

Related Questions