3F / DllExport

.NET DllExport with .NET Core support (aka 3F/DllExport aka DllExport.bat)
MIT License
940 stars 131 forks source link

Exported name mismatched #129

Closed Executor-Cheng closed 4 years ago

Executor-Cheng commented 4 years ago

Using v1.7-beta2, checked Use our IL Assembler, TargetFramework=netcoreapp3.1, the following method will be exported as "Test", not "test123".

[DllExport("test123", CallingConvention.StdCall)]
public static int Test()
    => 0;

But if I use CallingConvention.Cdecl, the exported name will be "test123".

3F commented 4 years ago

nice catch for 1h ago released version :) I can't even imagine where this broken part if cdecl ok. Is this reproducible for prev beta? I'll look into later, just 3 AM on my watch. Thanks for the report!

**edited: removed ....email_token=AAYYT7NQFORCMBXZIENOFN3QY...
Why github brokes my mails sometimes?

Executor-Cheng commented 4 years ago

Sorry, I made a mistake. It seems that the bug is related to DllExportAttribute.CallingConvention property. Modify this property will cause the bug.

[DllExport("test123")] // Correct
[DllExport("test123", CallingConvention.Cdecl)] // Incorrect
[DllExport("test123", CallingConvention = CallingConvention.Cdecl)] // Incorrect

Previous version is ok.

3F commented 4 years ago

@Executor-Cheng, Please confirm fixes using the following CI build: https://ci.appveyor.com/project/3Fs/dllexport-ix27o/builds/29539703/artifacts

I'll try to prepare new release ASAP.

Executor-Cheng commented 4 years ago

Great! The problem has been solved! Thank you for your quick fix :)

3F commented 4 years ago

Done. Please use Beta3 release.