How to add Assembly Info to your VB .NET Programs.
Done by Shanaz Bin Mohamed Abdul Lathiff
This small article is an attempt at explaining the usage of Assembly Info in VB.NET applications.
Assemblies - What are They ?
An assembly is the building block of a .NET application. It is a self
describing collection of code, resources, and metadata (data about data,
example, name, size, version of a file is metadata about that file). An
Assembly is a complied and versioned collection of code and metadata that
forms an atomic functional unit. Assemblies take the form of a dynamic
link library (.dll) file or executable program file (.exe) but they differ
as they contain the information found in a type library and the information
about everything else needed to use an application or component.
All .NET programs are constructed from these Assemblies. Assemblies are
made of two parts: manifest, contains information about what is contained
within the assembly and modules, internal files of IL code which are ready
to run. When programming, we don't directly deal with assemblies as the
CLR and the .NET framework takes care of that behind the scenes. The assembly
file is visible in the Solution Explorer window of the project.
We can include the following details in assembly:
AssemblyTitle:
Specifies a string for the Title field in the assembly. Place the string
in double quotation marks (" ") if text contains a space. This
string is a custom attribute on the assembly and is available for viewing
with reflection. If text is an empty string, the Win32 Description resource
appears as a single space. You can also specify this option as a custom
attribute
(System.Reflection.AssemblyTitleAttribute) in the source code for any
MSIL module.
AssemblyDescription:
Specifies a string for the Description field in the assembly. Place the
string in double quotation marks (" ") if text contains a space.
This string is a custom attribute on the assembly and is available for
viewing with reflection. If text is an empty string, the Win32 Comments
resource appears as a single space. You can also specify this option as
a custom attribute
(System.Reflection.AssemblyDescriptionAttribute) in the source code for
any MSIL module.
AssemblyCompany:
Specifies a string for the Company field in the assembly. Place the string
in double quotation marks (" ") if text contains a space. This
string is a custom attribute on the assembly and is available for viewing
with reflection. If text is an empty string (""), the Win32
Company resource appears as a single space. You can also specify this
option as a custom attribute
(System.Reflection.AssemblyCompanyAttribute) in the source code for any
MSIL module.
AssemblyProduct:
Specifies a string for the Product field in the assembly. Place the string
in double quotation marks (" ") if text contains a space. This
string is a custom attribute on the assembly and is available for viewing
with reflection. If text is an empty string, the Win32 Product Name resource
appears as a single space. You can also specify this option as a custom
attribute
(System.Reflection.AssemblyProductAttribute) in the source code for any
MSIL module.
AssemblyCopyright:
Specifies a string for the Copyright field in the assembly. Place the
string in double quotation marks (" ") if text contains a space.
This string is a custom attribute on the assembly and is available for
viewing with reflection. If text is an empty string, the Win32 Copyright
resource appears as a single space. You can also specify this option as
a custom attribute
(System.Reflection.AssemblyCopyrightAttribute) in the source code for
any MSIL module.
AssemblyTrademark:
Specifies a string for the Trademark field in the assembly. Place the
string in double quotation marks (" ") if text contains a space.
This string is a custom attribute on the assembly and is available for
viewing with reflection. If text is an empty string, the Win32 Trademark
resource appears as a single space. You can also specify this option as
a custom attribute
(System.Reflection.AssemblyTrademarkAttribute) in the source code for
any MSIL module.
AssemblyVersion:
Specifies version information for this assembly. The format of the version
string is major.minor.build.revision. The default value is 0.
If you do specify /version, you must specify major. If you specify major
and minor, you can specify an asterisk (*) for build. This cause build
to be equal to the number of days since January 1, 2000, local time, and
revision to be equal to the number of seconds since midnight, January
1, 2000, local time, divided by 2.
If you specify major, minor, and build, you can specify an asterisk for
revision. This causes revision to be equal to the number of seconds since
midnight, January 1, 2000, local time, divided by 2.
To summarize, the valid version strings are:
X
X.X
X.X.*
X.X.X
X.X.X.*
X.X.X.X
where X is any unsigned short constant except 65535 (0-65534). You can
also specify this option as a custom attribute
(System.Reflection.AssemblyVersionAttribute) in the source code for any
MSIL module.
Conclusion
These above given Tips can be used by a .NET developer for adding his
company details and other product related details to an executable file.
