Getting at the VS_VERSION_INFO

  • Thread starter Thread starter herc
  • Start date Start date
H

herc

Programmatically I need to get to the VS_VERSION_INFO of a module.
Specifically I need to get the AssemblyFileVersion of the current
assembly, that looks to be the FileVersion of the VS_VERSION_INFO. How
does one do that in .Net 2.0?
 
This seems to work for now:

Assembly currentAssembly = Assembly.GetExecutingAssembly();
foreach (object o in
currentAssembly.GetCustomAttributes(typeof(AssemblyFileVersionAttribute),
false))
{
AssemblyFileVersionAttribute afv = o as
AssemblyFileVersionAttribute;
if (afv != null)
return afv.Version;
}
 
Programmatically I need to get to the VS_VERSION_INFO of a module.
Specifically I need to get the AssemblyFileVersion of the current
assembly, that looks to be the FileVersion of the VS_VERSION_INFO. How
does one do that in .Net 2.0?

You can use the FileVersionInfo class.


Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top