views:

9

answers:

1

I’ve been asked to list all the names and version numbers of all the services, executables and dlls that make up my project. We need to keep a record of this for each release. Is there a tool in Visual Studio that will generate a report or log automatically ? If not, does anyone have a possible solution ?

A: 

As far as I know there's nothing that will do this automatically.

However, you can use reflection to do this, assuming that you use the regular .NET assembly versions:

foreach (string fileName in Directory.GetFiles(@"c:\mypath"))
{
    AssemblyName assemblyName = Assembly.LoadFrom(filename).GetName();
    Console.WriteLine(string.Format("{0} {1}", fileName, assemblyName.Version.ToString(4)));
}
Jeremy McGee