Hello,
I have discovered that the function GetEntryAssembly fails if there is a dll with the same name as the calling executable.
For example:
CompanyName.AppName.exe
CompanyName.AppName.dll
In this case the GetEntryAssembly function will return the dll instead of the calling executable.