Hi All, when load dll file using .net reflection(the loaded file description is : Microsoft C Runtime Library), I got Run time error (R6034) when load dll that not using C runtime library it will be loaded successfully, can I load dll that using C runtime using .net reflection, if not, then how to catch this exception ? Find my code below:
class ReverseDLL
{
private Assembly assembly;
private AssemblyDescriptionAttribute desc;
private AssemblyTitleAttribute title;
private AssemblyCopyrightAttribute copyRight;
public string getCopyright(string path)
{
try
{
assembly = System.Reflection.Assembly.LoadFrom(path);
}
catch { Console.WriteLine("(private message)Class ReverseDll : Couldn't load dll"); }
try
{
string verInfo = assembly.GetName().Version.ToString();
desc = (AssemblyDescriptionAttribute)
AssemblyDescriptionAttribute.GetCustomAttribute(
assembly, typeof(AssemblyDescriptionAttribute));
title = (AssemblyTitleAttribute)
AssemblyTitleAttribute.GetCustomAttribute(
assembly, typeof(AssemblyTitleAttribute));
copyRight = (AssemblyCopyrightAttribute)AssemblyCopyrightAttribute.GetCustomAttribute(assembly, typeof(AssemblyCopyrightAttribute));
Console.WriteLine("Class ReverseDll , signature: " + copyRight.Copyright.ToString());
}
catch
{
this.copyRight = new AssemblyCopyrightAttribute("");
Console.WriteLine("(private message)Class ReverseDll : reflection not able to pull the needed data ");
}
return copyRight.Copyright;
}
}