-
Notifications
You must be signed in to change notification settings - Fork 593
NativeModuleWriter - Could not create header #305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Yes, this is an old todo. That file is probably an R2R assembly (created by the crossgen tool), and you should probably just save it as a normal IL assembly, and optionally run crossgen on it again. |
If you save it as an IL assembly, you may need to clear the IL Library bit too. |
I tried setting However, now it crashes when I try to use it. Whenever I try to load an assembly which uses new System.Private.CoreLib it crashes with following message: When I try to run crossgen on new System.Private.CoreLib it throws this: Could not load file or assembly '<PATH>\System.Private.CoreLib.dll'. Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
Error: compilation failed for ".\System.Private.CoreLib.dll" (0x80004005) I forgot to mention that my original approach (using native write) worked on Windows and I have been actually using it for the past 3 or 4 months. I started to experience issues once I tried to get it working on Linux. |
When testing new / instrumented assemblies I am doing it with following settings: |
It's the IL Library bit, but there could be more bits. I suggest you compare the bits with a normal DLL and make sure they're identical. Then save it. The file is smaller because it doesn't contain native code. System.Private.CoreLib.dll is crossgen'd. |
Also compare other stuff, eg. the PE stuff such as the Machine property (should be eg. I386 or AMD64 etc) |
You were right with your first comment. I did not realize that there is actually an Just one more questions regarding the fix:
Anyway thank you for your help with this issue. This is truly a great library. |
I doubt you'll break anything, but you can always re-run crossgen to get the native code back and probably faster startup (make sure you use the correct version). |
Ok. Thanks for you help! |
Currently native writer fails for some assemblies.
This is caused by an unimplemented feature at the end of
CreateHeaderSection
in classNativeModuleWriter
:Reproduce issue
dotnet new console
dotnet publish --runtime ubuntu.18.04-x64
Exprected result: Assembly is stored to disk
Actual result: An exception is thrown
Is there any chance that this will be implemented?
Also let me know if you need additional info.
The text was updated successfully, but these errors were encountered: