I am currently working on a C# project in which I load libraries using Kernel32->LoadLibrary() and also integrate (statically linked ???) libraries in VS 2022 17.1.1.
Now I read information about the libraries, which were integrated using LoadLibrary(), simply with Kernel32->GetModuleFileName() and FileVersionInfo.GetVersionInfo().
But I don't have access to the path of the statically linked libraries in the project to get more information using FileVersionInfo.
For example, I tried with
typeof(__NAMESPACE___.__ONE_EXEMPLE_INTERFACE_OR_CLASS__).Assembly.Location
to get the path, but the Type's assembly is my own application. Probably because the library is integrated with "embedded interop types". But I can't change that. Is there another way?
By the way: If I look up the full path myself (e.g. with a process monitor) and determine information using FileVersionInfo, everything works. But the path can vary, so I would like to determine it at runtime.
One of the libraries which are statically linked / embedded in VS:
Resolved: true
Filetype: ActiveX
embedd Interoptypes: true
isolated: false
local copy: false
strong name: false
I tested LoadLibrary + GetModuleFileName. But the library is not found by the Kernel32 / GAC. Then I tried to determine the path using the type of a class and the associated assembly. But the assembly is my own program.