Skip to content

ModuleWriterException: Invalid section RVA #545

@Drovosek01

Description

@Drovosek01

I'm exploring. A dll file compiled using dotNet on a Mac with Apple Silicon processors.

I open the file in dnSpyEx v6.5.0 and then just try to save the module without any modifications
Screenshot 2024-02-19 at 16 03 42
and I get an error:

An exception has occurred dnlib.DotNet.Writer.ModuleWriterException: Invalid section RVA
   at dnlib.DotNet.Writer.NativeModuleWriter.WriteFile()
   at dnlib.DotNet.Writer.NativeModuleWriter.Write()
   at dnlib.DotNet.Writer.NativeModuleWriter.WriteImpl()
   at dnlib.DotNet.Writer.ModuleWriterBase.Write(Stream dest)
   at dnlib.DotNet.Writer.ModuleWriterBase.Write(String fileName)
   at dnlib.DotNet.ModuleDefMD.NativeWrite(String filename, NativeModuleWriterOptions options)
   at dnSpy.AsmEditor.SaveModule.ModuleSaver.Save(SaveModuleOptionsVM vm) in D:\a\dnSpy\dnSpy\Extensions\dnSpy.AsmEditor\SaveModule\ModuleSaver.cs:line 187
   at dnSpy.AsmEditor.SaveModule.ModuleSaver.SaveAll() in D:\a\dnSpy\dnSpy\Extensions\dnSpy.AsmEditor\SaveModule\ModuleSaver.cs:line 151
   at dnSpy.AsmEditor.SaveModule.SaveMultiModuleVM.SaveAsync(SaveOptionsVM[] mods) in D:\a\dnSpy\dnSpy\Extensions\dnSpy.AsmEditor\SaveModule\SaveMultiModuleVM.cs:line 250
Screenshot 2024-02-19 at 16 04 00

I tried to do this on Windows 10 x64 on an AMD laptop, and also tried to do it on Windows 11 ARM via Parallels Desktop and always get the same error.

Does anyone know how to fix this? Here is an example of such a file:
CsvHelper dll for arm64.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions