CodemerxDecompile icon indicating copy to clipboard operation
CodemerxDecompile copied to clipboard

Application will not open assembly

Open sean-neeley opened this issue 2 years ago • 6 comments

I'm trying to use the application for the first time on Windows. I launch it and choose "Open Assembly", I pick my EXE that was built from a .NET project. Then nothing happens. No error messages, nothing changes in the UI. So it seems like it doesn't like something about the EXE file. How do I get further help with this? Is there a log I can look at?

sean-neeley avatar Apr 18 '23 16:04 sean-neeley

Hello. Which version of .NET has been used for the compilation of that project?

atdimitrov avatar Apr 21 '23 13:04 atdimitrov

Hello. Which version of .NET has been used for the compilation of that project?

I only have the compiled EXE and not the source, thus the reason for needing to decompile. I opened it successfully with dotPeek and ILspy. They show:

[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = "")]

sean-neeley avatar Apr 21 '23 14:04 sean-neeley

This assembly seems to be built with .NET 6. Starting with .NET Core, projects (even application projects like console applications) do not generate .exe files. This is due to the fact that .exe files are Windows executables and .NET Core aims to be platform-independent. During publishing for Windows an .exe file is generated, but that .exe file is not a CLR assembly, it's a native one. CodemerxDecompile cannot read native assemblies, hence the problem. The solution would be to open the .dll with the same name as the .exe. It can be found in the same folder next to the .exe. This .dll contains the entry logic to the application.

That being said it doesn't mean the current handling is adequate. There should be a message explaining to the user that the assembly that is being loaded is not a CLR assembly and it is not supported. A bonus mini-feature would be to detect that there's a .dll with the same name next to the native assembly and suggest we load that instead, covering the most common case.

atdimitrov avatar Apr 21 '23 15:04 atdimitrov

Hmm, there is no DLL next to the EXE. Also I believe that this particular EXE was originally named with .dll and someone renamed it to EXE. I tried renaming to .dll and CodemerxDecompile still did nothing. I got what I needed now by using a different product (dotPeek). I think it would be nice if your app was improved to give some kind of indicator of the problem, especially since the file open dialog lets you pick an EXE or DLL file on disk. If you need me to send you the exe file, let me know.

sean-neeley avatar Apr 21 '23 18:04 sean-neeley

That's interesting. I have to check the assembly in order to figure out what's going on. Could you, please, upload the assembly causing the issue? Keep in mind you may need to zip it first in order for GitHub to allow you to upload it.

atdimitrov avatar Apr 24 '23 14:04 atdimitrov

PProPrintService.zip

See attached file

sean-neeley avatar Apr 24 '23 14:04 sean-neeley