Running dump-media crashes on Windows 10 x64 #209

Closed
opened 2026-01-29 15:13:13 +00:00 by claunia · 6 comments
Owner

Originally created by @TheRogueArchivist on GitHub (Jun 19, 2018).

Prerequisites

  • Are you running the latest version?
  • Can you reproduce the problem in the debug version?

Check and fill as appropiate:

  • I was running DiscImageChef under Windows 10 x64 Version 1803...
  • ...using .NET Framework [4.7.2]...

Description

Running the dump-media command crashes DiscImageChef. On Debug, it says
Unhandled Exception: System.BadImageFormatException: Could not load file or assembly 'DiscImageChef.Devices, Version=4.0.99.1629, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format. at DiscImageChef.Commands.DumpMedia.DoDumpMedia(DumpMediaOptions options) at DiscImageChef.MainClass.<>c.<Main>b__0_13(DumpMediaOptions opts) at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult1 result, Action1 action) at DiscImageChef.MainClass.Main(String[] args)
and on Release it says
Unhandled Exception: System.OverflowException: Arithmetic operation resulted in an overflow. at DiscImageChef.Devices.Windows.Usb.FindDeviceNumber(Int32 devNum, String deviceGuid) in C:\Users\silas\Desktop\GIT\DIC\DiscImageChef.Devices\Windows\UsbFunctions.cs:line 204 at DiscImageChef.Devices.Device..ctor(String devicePath) in C:\Users\silas\Desktop\GIT\DIC\DiscImageChef.Devices\Device\Constructor.cs:line 480 at DiscImageChef.Commands.DumpMedia.DoDumpMedia(DumpMediaOptions options) at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult1 result, Action1 action) at DiscImageChef.MainClass.Main(String[] args).

It may be an issue with my version/setup of Windows, as older, debug versions of DiscImageChef that worked before don't seem to work now. I genuinely don't know if I messed up my configuration somehow or if an update broke compatibility. I did re-download and recompile DiscImageChef several times to be sure. No logs appear in the working directory when it crashes, but let me know if there's anything else I can do to help pinpoint it down.

Originally created by @TheRogueArchivist on GitHub (Jun 19, 2018). ### Prerequisites * [X] Are you running the latest version? * [X] Can you reproduce the problem in the debug version? ### Check and fill as appropiate: * [X] I was running DiscImageChef under Windows 10 x64 Version 1803... * [X] ...using .NET Framework [4.7.2]... ### Description Running the dump-media command crashes DiscImageChef. On Debug, it says `Unhandled Exception: System.BadImageFormatException: Could not load file or assembly 'DiscImageChef.Devices, Version=4.0.99.1629, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format. at DiscImageChef.Commands.DumpMedia.DoDumpMedia(DumpMediaOptions options) at DiscImageChef.MainClass.<>c.<Main>b__0_13(DumpMediaOptions opts) at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult`1 result, Action`1 action) at DiscImageChef.MainClass.Main(String[] args)` and on Release it says `Unhandled Exception: System.OverflowException: Arithmetic operation resulted in an overflow. at DiscImageChef.Devices.Windows.Usb.FindDeviceNumber(Int32 devNum, String deviceGuid) in C:\Users\silas\Desktop\GIT\DIC\DiscImageChef.Devices\Windows\UsbFunctions.cs:line 204 at DiscImageChef.Devices.Device..ctor(String devicePath) in C:\Users\silas\Desktop\GIT\DIC\DiscImageChef.Devices\Device\Constructor.cs:line 480 at DiscImageChef.Commands.DumpMedia.DoDumpMedia(DumpMediaOptions options) at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult`1 result, Action`1 action) at DiscImageChef.MainClass.Main(String[] args)`. It may be an issue with my version/setup of Windows, as older, debug versions of DiscImageChef that worked before don't seem to work now. I genuinely don't know if I messed up my configuration somehow or if an update broke compatibility. I did re-download and recompile DiscImageChef several times to be sure. No logs appear in the working directory when it crashes, but let me know if there's anything else I can do to help pinpoint it down.
Author
Owner

@claunia commented on GitHub (Jun 20, 2018):

Remove the source folder and pull again from GIT, that exception is quite nonsense I fear.

https://github.com/claunia/DiscImageChef/blob/master/DiscImageChef.Devices/Windows/UsbFunctions.cs#L204 cannot raise an exception.

Also, https://msdn.microsoft.com/en-us/library/system.badimageformatexception%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396 it is complaining that DiscImageChef.Devices.dll is not the version or format it should be.

@claunia commented on GitHub (Jun 20, 2018): Remove the source folder and pull again from GIT, that exception is quite nonsense I fear. https://github.com/claunia/DiscImageChef/blob/master/DiscImageChef.Devices/Windows/UsbFunctions.cs#L204 cannot raise an exception. Also, https://msdn.microsoft.com/en-us/library/system.badimageformatexception%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396 it is complaining that DiscImageChef.Devices.dll is not the version or format it should be.
Author
Owner

@claunia commented on GitHub (Jun 20, 2018):

Tested it on a Windows 10 build 1803 with a USB device and error does not reproduce, so yeah definitively something about your development environment sorry.

@claunia commented on GitHub (Jun 20, 2018): Tested it on a Windows 10 build 1803 with a USB device and error does not reproduce, so yeah definitively something about your development environment sorry.
Author
Owner

@TheRogueArchivist commented on GitHub (Jun 20, 2018):

Ok, thank you for verifying that it is on my end! I was able to fix it by compiling using JetBrains Rider instead of Visual Studio 2017. When I get the time/motivation I'll try reinstalling VS and see if I can make it work again.

@TheRogueArchivist commented on GitHub (Jun 20, 2018): Ok, thank you for verifying that it is on my end! I was able to fix it by compiling using JetBrains Rider instead of Visual Studio 2017. When I get the time/motivation I'll try reinstalling VS and see if I can make it work again.
Author
Owner

@claunia commented on GitHub (Jun 20, 2018):

That's a known VS2017 bug I've seen in several projects. Solution, delete all bin and obj folders, delete nuget packages folder, open again in VS, restore nuget packages, build solution, and voilà.

@claunia commented on GitHub (Jun 20, 2018): That's a known VS2017 bug I've seen in several projects. Solution, delete all bin and obj folders, delete nuget packages folder, open again in VS, restore nuget packages, build solution, and voilà.
Author
Owner

@claunia commented on GitHub (Jun 20, 2018):

@SilasLaspada forget my last comment can you try if -master is compiling and running correctly on x64?

@claunia commented on GitHub (Jun 20, 2018): @SilasLaspada forget my last comment can you try if -master is compiling and running correctly on x64?
Author
Owner

@TheRogueArchivist commented on GitHub (Jun 20, 2018):

Ok, it works on VS again! Thank you for your help.

@TheRogueArchivist commented on GitHub (Jun 20, 2018): Ok, it works on VS again! Thank you for your help.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: aaru-dps/Aaru-aaru-dps#209