Open wuyu8512 opened 4 years ago
By design. Your case requires .NET Standard 2.0 (where export).
Although, more probably I will also consider later our "rebasing feature" for other system-based types in higher versions of .NET Core. See details: https://github.com/3F/DllExport/pull/123
Today, only System Object. Follow the news.
I reworked my VS solution from https://github.com/3F/DllExport/issues/134 to use .NET Standard 2.0 (x64) library and now I get this exception:
This exception is only displayed when run in console.
Unhandled exception. System.DllNotFoundException: Unable to load DLL 'ExportLib.dll' or one of its dependencies: A dynamic link library (DLL) initialization routine failed. (0x8007045A)
at ImportApp.ImportClass.ExportMethod()
at ImportApp.Program.Main(String[] args) in D:\Sync\Projects\DllExport_SEH\ImportApp\Program.cs:line 9
Application exits with code: This is displayed when run in debug mode.
The program '[8740] ImportApp.exe' has exited with code -1073741819 (0xc0000005) 'Access violation'.
Modified VS Solution: DllExport_SEH_2.zip
Anyway, is there a way how to make this work on .NET Standard 2.1? Or are you planning to support it anytime soon? We just migrated our entire codebase to .NET Standard 2.1/.NET Core 3.1 so this would save us a ton of work. I tried reading the links you posted but to be completely honest, I do not understand much of it (I'm not an ILAsm expert).
@esso23
That's how MS implements CLR support when pe-module starts to be processed on host machine.
For this repo I can implement some additional behavior in my custom assembler for additional rebasing of the types in final modules. Like it was already for system object (1.7-beta3).
For my other way please follow the news: https://github.com/3F/DllExport/issues/90#issuecomment-546637702
Or are you planning to support it anytime soon?
It can be considered at least only after 1.7 release. Not earlier. Time will tell.
I'm not an ILAsm expert
IL Assembler is mainly frontend. Well, at least this applies to the coreclr implementation which is different from the netfx implementation (no open source). Legit support requires more such processing for System.Private.Corlib / mscorlib.
System.DllNotFoundException: Unable to load DLL 'ExportLib.dll'
I only unpacked your DllExport_SEH_2.zip and I don't see problems in VS 16.4.2. Please open new issue for how to reproduce this error. Thanks.
Hello
I'm trying dllexport for .NET Core When I use System.Reflection.Assembly.GetExecutingAssembly (), it throws an exception
v1.7beta3: Manager: Tried both
x86, x64
andDirect-Mod/Cecil
andRebase System Object
in all possible variants. Project type: .NET Core 3.1.100 Class LibraryCode:
Calling code
Thank you for your contribution to this project