I have a project I'm working on in which I parse a .vbp file which contains a list of paths to assemblies and their GUID's (along with other things). The goal in parsing the file is to use the full path of each assembly to load them, and then use Reflection to get information about each assembly such as its interfaces and the methods and properties they define.
Now the code I have so far works just fine on managed assemblies (such as a .exe written in C#), however all of these assemblies that are being loaded are unmanaged C++/VB assemblies. When I try calling:
var assemblyPath = @"C:\*path to unmanaged .dll*";
var assemblyObj = Assembly.LoadFrom(assemblyPath);
on the unmanaged assemblies, I get a BadImageFormat exception, which is expected since it isn't a managed assembly. I've looked all over for how to go about this but most of the information I've found so far has been asking about actually using the things defined in unmanaged assemblies. In these instances, the solution required knowing information such as the name of a function the User was trying to get from the unmanaged assembly to utilize in their managed application. The only things I know about the assemblies are their paths, names, and that they're unmanaged C++/VB. I don't need to call any functions or use anything from these assemblies, I just need to obtain their information such as the names of their defined interfaces and the signatures of the methods within those interfaces.
Two pages I've found that looked promising are:
While I've looked through these, I can't claim to be well-versed in Reflection, or even .NET, and as such I'm not really sure what I should be going with/how to implement what I'm trying to do.
Aucun commentaire:
Enregistrer un commentaire