I have a Windows WPF application which compiles to "MyApp.exe". This application references my DLL named "MyDll.dll". In DLL, I have following function:
public string GetFileDescription()
{
System.Diagnostics.FileVersionInfo fileVersionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
return fileVersionInfo.FileDescription;
}
This function supposed to read file description of the executable. But, it is returning same of DLL instead.
If I copy the function to application, it just works fine. But the function should stay in DLL.
How to get assembly information of executable from the referenced dll?
References:
I read multiple questions (including this) on Stack Overflow but none of it involves DLL. This question is about executable name; I want executable file description.