开发者

Listing all the files that make up a deployed project

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜