You need to get the AssemblyName object for the assembly. For example, for
the currently executing assembly use:
Version assemblyVersion = Assembly.GetExecutingAssembly().GetName().Version;
To print out the version of every assembly referenced by the main assembly
of you app to this:
foreach(AssemblyName assemblyName in
Assembly.GetEntryAssembly().GetReferencedAssemblies())
{
// Print out the name and version of the assemblies
Console.WriteLine(assemblyName.Name + "\t" + assemblyName.Version);
}
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.