I created a managed dll and I would like to get the executable name to which it is attached .... I read: How to get the executable path from a managed DLL
It works fine with .net executables .... but when a DLL starts in a com process, I don’t have a .Net assembly ... so Assembly.GetEntryAssembly () will not return anything ....
Any ideas?
What about:
using System.Diagnostics; ... Process process = Process.GetCurrentProcess(); string name = process.ProcessName; ProcessModule module = process.MainModule; string path = module == null ? null : module.FileName;
Source: https://habr.com/ru/post/1704722/More articles:How can I refer to configuration information from multiple class libraries? - c #WPF Grid Question, can I determine the absolute position of something that automatically positions itself in the WPF grid? - wpfLINQ to SQL - проблема с ассоциацией 1-to-1 - c#Как отлаживать удаленный бинарный файл Linux? - linuxWinXP button style with wxPython - pythonDuplicate service - code and documentation - javaRegister Symfony - phpHow to safely check a version of the .NET Framework using a version of the .NET Framework that may not exist? - c #Unique, numeric, incremental identifier - uniqueidentifierHow do I enable text selection, copying, and pasting in the Shoes app? - ruby | fooobar.comAll Articles