AssemblyInfo.cs is a standard file in c# projects that contains metadata about the assembly like its title, copyright or version, declared using .net attributes.
Questions tagged [assemblyinfo]
206 questions
394
votes
27 answers
Can I automatically increment the file build version when using Visual Studio?
I was just wondering how I could automatically increment the build (and version?) of my files using Visual Studio (2005).
If I look up the properties of say C:\Windows\notepad.exe, the Version tab gives "File version: 5.1.2600.2180". I would like…

Ian G
- 29,468
- 21
- 78
- 92
336
votes
8 answers
Equivalent to AssemblyInfo in dotnet core/csproj
Since dotnet core moved back to the .csproj format, there is a new autogenerated MyProject.AssemblyInfo.cs which contains, among others:
[assembly: AssemblyCompany("MyProject")]
[assembly: AssemblyVersion("1.0.0.0")]
Note that this is automatically…

hultqvist
- 17,451
- 15
- 64
- 101
249
votes
6 answers
Getting assembly name
C#'s exception class has a source property which is set to the name of the assembly by default.
Is there another way to get this exact string (without parsing a different string)?
I have tried the following:
catch(Exception e)
{
string str =…

Patrick
- 8,175
- 7
- 56
- 72
167
votes
8 answers
What are the best practices for using Assembly Attributes?
I have a solution with multiple project. I am trying to optimize AssemblyInfo.cs files by linking one solution wide assembly info file. What are the best practices for doing this? Which attributes should be in solution wide file and which are…

Jakub Šturc
- 35,201
- 25
- 90
- 110
94
votes
3 answers
Visual Studio 2017 and the new .csproj InternalsVisibleTo
Where do I put InternalsVisibleTo from AssemblyInfo in the new Visual Studio 2017 .csproj project file?

Luka
- 4,075
- 3
- 35
- 61
85
votes
7 answers
The specified version string does not conform to the required format - major[.minor[.build[.revision]]]
I want to append our application version with the build number. For example, 1.3.0.201606071.
When setting this in the AssemblyInfo, I get the following compilation error:
Error CS7034 The specified version string does not conform to the
…

Dave New
- 38,496
- 59
- 215
- 394
35
votes
2 answers
What is the ThemeInfo attribute for?
Whenever I create a new WPF application or WPF user control library, the AssemblyInfo.cs file includes the following attribute:
[assembly: ThemeInfo(
ResourceDictionaryLocation.None,
//where theme specific resource dictionaries are located
…

Joe White
- 94,807
- 60
- 220
- 330
34
votes
6 answers
How to get the AssemblyVersion of a .Net file in Linux
Is there any way to obtain the AssemblyVersion of a .Net executable in Linux without using mono? What I am trying to have is a script or command that will let me obtain the AssemblyVersion on Linux boxes. I tried: #strings file.exe | grep…

Freddy
- 3,064
- 3
- 26
- 27
33
votes
6 answers
C# AssemblyFileVersion usage within a program
I'm working on a program, and I'm trying to display the assembly FILE version
public static string Version
{
get
{
Assembly asm = Assembly.GetExecutingAssembly();
FileVersionInfo fvi =…

Zack
- 2,477
- 4
- 37
- 50
32
votes
2 answers
Getting Assembly Version from AssemblyInfo.cs
We have an AssemblyInfo.cs file in our Web Application but we do have other projects in the same solution. They are mostly class libraries. I am told to display Assembly Version from AssemblyInfo.cs on our UI. I've found the following solution in SO…

Tarik
- 79,711
- 83
- 236
- 349
29
votes
3 answers
How can I retrieve the 'AssemblyCompany' setting (in AssemblyInfo.cs)?
Is it possible to retrieve this value at runtime?
I'd like to keep the value in one place, and retrieve it whenever my application needs to output the name of my company.

Jonathan
- 32,202
- 38
- 137
- 208
28
votes
3 answers
"LNK2022: metadata operation failed" driving me insane
I have a big solution with lots of projects, using VS2008 SP1, and at least once a day I encounter the LNK2022 error. If I do a full rebuild of the solution it builds fine, but this is not fun.
It happens when a dependent DLL is changed…

demoncodemonkey
- 11,730
- 10
- 61
- 103
25
votes
2 answers
Do I need AssemblyInfo while working with .NET Core?
Previously, AssemblyInfo.cs file was autocreated by Visual Studio to contain assembly-wide attributes, like AssemblyVersion, AssemblyName and so on.
In .NET Core and ASP.NET Core, project.json is responsible for holding most of that information.
So…

brutallord
- 861
- 2
- 11
- 16
24
votes
3 answers
How can I change AssemblyProduct, AssemblyTitle using MSBuild?
I have an MSBuild script which compiles my existing solution but I'd like to change some properties of one of the projects within the solution at compile-time, including but not limited to AssemblyProduct and AssemblyTitle.
Here's a snippet of my…

Charlie Salts
- 13,109
- 7
- 49
- 78
20
votes
4 answers
Should AssemblyInfo.cs be placed in version control?
I have an automated build system using CruiseControl. I am using the SvnRevisionLabeller to to get the version string to use. With this string I can use nant to update AssemblyInfo.cs so when I build it has the correct build string. I can also use…

Liam Donaldson
- 201
- 2
- 3