开发者

Listing all the files that make up a deployed project

开发者 https://www.devze.com 2022-12-14 14:04 出处:网络
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 Visu

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 repor开发者_运维知识库t or log automatically ? If not, does anyone have a possible solution ?


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)));
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号