Currently native writer fails for some assemblies.
This is caused by an unimplemented feature at the end of CreateHeaderSection in class NativeModuleWriter:
//TODO: Support this too
throw new ModuleWriterException("Could not create header");
Reproduce issue
- Create clean console application using
dotnet new console
- Publish with ubuntu RID, for example,
dotnet publish --runtime ubuntu.18.04-x64
- Try to load published System.Private.CoreLib.dll and write it back to disk
var module = AssemblyDef.Load("System.Private.CoreLib.dll");
((ModuleDefMD)module.ManifestModule).NativeWrite("System.Private.CorLib.dll-2");
Exprected result: Assembly is stored to disk
Actual result: An exception is thrown
dnlib.DotNet.Writer.ModuleWriterException: Could not create header
at dnlib.DotNet.Writer.NativeModuleWriter.CreateHeaderSection(IChunk& extraHeaderData)
at dnlib.DotNet.Writer.NativeModuleWriter.WriteFile()
at dnlib.DotNet.Writer.NativeModuleWriter.WriteImpl()
at dnlib.DotNet.Writer.ModuleWriterBase.Write(Stream dest)
at dnlib.DotNet.Writer.ModuleWriterBase.Write(String fileName)
Is there any chance that this will be implemented?
Also let me know if you need additional info.
Currently native writer fails for some assemblies.
This is caused by an unimplemented feature at the end of
CreateHeaderSectionin classNativeModuleWriter:Reproduce issue
dotnet new consoledotnet publish --runtime ubuntu.18.04-x64Exprected 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.