D
Dave Hall
Can anyone get me started on identifying the version of the EXE and all DLLs
in an assembly. I'm trying to build a class in a DLL that can be included in
any assembly, which will determine all of the DLLs in that assembly, as well
as the EXE, and then provide a tab and newline delimited string with all of
their names and versions. So far, I have been able to determine the version
of the DLL that my code runs in, but not the version of the EXE or any other
DLLs in the application. Here's the code I have so far:
System.Reflection.Assembly thisAssy =
System.Reflection.Assembly.GetExecutingAssembly();
string str = thisAssy.GetName().Name + "\t" +
System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString
();
System.Reflection.Module[] modules = thisAssy.GetModules();
foreach(System.Reflection.Module module in modules)
{
// Where do we really get info on all of the DLLs?
str = str + "\n" + module.Name + "\t" +
module.Assembly.GetName().Version.ToString();
}
return str;
Thanks,
Dave
in an assembly. I'm trying to build a class in a DLL that can be included in
any assembly, which will determine all of the DLLs in that assembly, as well
as the EXE, and then provide a tab and newline delimited string with all of
their names and versions. So far, I have been able to determine the version
of the DLL that my code runs in, but not the version of the EXE or any other
DLLs in the application. Here's the code I have so far:
System.Reflection.Assembly thisAssy =
System.Reflection.Assembly.GetExecutingAssembly();
string str = thisAssy.GetName().Name + "\t" +
System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString
();
System.Reflection.Module[] modules = thisAssy.GetModules();
foreach(System.Reflection.Module module in modules)
{
// Where do we really get info on all of the DLLs?
str = str + "\n" + module.Name + "\t" +
module.Assembly.GetName().Version.ToString();
}
return str;
Thanks,
Dave