question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Crash when pick a file with OpenFileDialog - System.ComponentModel.Win32Exception

See original GitHub issue

Describe the bug Program crash when pick a file with OpenFileDialog. I can’t replicate this on my machine and never experienced this, but multiple users have reported this not-so-often bug. Some this only happen when loading from USB drive, other from internal SSD but not from USB drive.

Crash 1 https://github.com/sn4k3/UVtools/issues/495

Loading from USB drive:

System.ComponentModel.Win32Exception (0x80004002): Interfaz no compatible
   at Avalonia.Win32.SystemDialogImpl.<>c__DisplayClass2_0.<ShowFileDialogAsync>b__0() in /_/src/Windows/Avalonia.Win32/SystemDialogImpl.cs:line 120
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.<>c.<.cctor>b__272_0(Object obj)
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at UVtools.WPF.MainWindow.OpenFile(Boolean newWindow, FileDecodeType fileDecodeType) in D:\Tiago\Dropbox\Programming\C#\UVtools\UVtools.WPF\MainWindow.axaml.cs:line 1013
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)
   at Avalonia.Threading.AvaloniaSynchronizationContext.<>c__DisplayClass5_0.<Post>b__0() in /_/src/Avalonia.Base/Threading/AvaloniaSynchronizationContext.cs:line 33
   at Avalonia.Threading.JobRunner.RunJobs(Nullable`1 priority) in /_/src/Avalonia.Base/Threading/JobRunner.cs:line 37
   at Avalonia.Win32.Win32Platform.WndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam) in /_/src/Windows/Avalonia.Win32/Win32Platform.cs:line 278
   at Avalonia.Win32.Interop.UnmanagedMethods.DispatchMessage(MSG& lpmsg)
   at Avalonia.Win32.Win32Platform.RunLoop(CancellationToken cancellationToken) in /_/src/Windows/Avalonia.Win32/Win32Platform.cs:line 205
   at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken) in /_/src/Avalonia.Base/Threading/Dispatcher.cs:line 65
   at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args) in /_/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 120
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode) in /_/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 209
   at UVtools.WPF.Program.Main(String[] args) in D:\Tiago\Dropbox\Programming\C#\UVtools\UVtools.WPF\Program.cs:line 70
Category: Application
Operative system: Microsoft Windows 10.0.18363 X64
Processor: AMD Ryzen 5 5600X 6-Core Processor             
Processor cores: 12
Memory RAM: 10.92 / 31.93 GB
Runtime: win10-x64
Framework: .NET 6.0.5
AvaloniaUI: 0.10.14

Crash 2 https://github.com/sn4k3/UVtools/issues/518

Loading from SSD internal drive:

System.ComponentModel.Win32Exception (0x80070057): Параметр задан неверно.
   at Avalonia.Win32.SystemDialogImpl.<>c__DisplayClass2_0.<ShowFileDialogAsync>b__0() in /_/src/Windows/Avalonia.Win32/SystemDialogImpl.cs:line 120
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.<>c.<.cctor>b__272_0(Object obj)
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at UVtools.WPF.MainWindow.OpenFile(Boolean newWindow, FileDecodeType fileDecodeType) in D:\Tiago\Dropbox\Programming\C#\UVtools\UVtools.WPF\MainWindow.axaml.cs:line 1015
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)
   at Avalonia.Threading.AvaloniaSynchronizationContext.<>c__DisplayClass5_0.<Post>b__0() in /_/src/Avalonia.Base/Threading/AvaloniaSynchronizationContext.cs:line 33
   at Avalonia.Threading.JobRunner.RunJobs(Nullable`1 priority) in /_/src/Avalonia.Base/Threading/JobRunner.cs:line 37
   at Avalonia.Win32.Win32Platform.WndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam) in /_/src/Windows/Avalonia.Win32/Win32Platform.cs:line 283
   at Avalonia.Win32.Interop.UnmanagedMethods.DispatchMessage(MSG& lpmsg)
   at Avalonia.Win32.Win32Platform.RunLoop(CancellationToken cancellationToken) in /_/src/Windows/Avalonia.Win32/Win32Platform.cs:line 210
   at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken) in /_/src/Avalonia.Base/Threading/Dispatcher.cs:line 65
   at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args) in /_/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 120
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode) in /_/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 209
   at UVtools.WPF.Program.Main(String[] args) in D:\Tiago\Dropbox\Programming\C#\UVtools\UVtools.WPF\Program.cs:line 70
Category: Application
Operative system: Microsoft Windows 6.1.7601 Service Pack 1 X64
Processor: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
Processor cores: 8
Memory RAM: 5.56 / 31.87 GB
Runtime: win7-x64
Framework: .NET 6.0.7
AvaloniaUI: 0.10.16

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:17 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
maxkatz6commented, Jul 28, 2022

@sn4k3 if you can remote debug it on user’s machine, I hope it’s possible to step into this implementation code and see after which step it fails.

1reaction
maxkatz6commented, Jul 28, 2022

Currently inner exception with specific error line is lost. In next stable 0.10.x version there will be fixed error handling in this class. See https://github.com/AvaloniaUI/Avalonia/commit/2d2cd97b55f82fe811ebd8cbce9e1e933fe940a8

Logging this inner exception should help as well in finding the problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Open File Dialog causes a dll issue in WPF application
I would like the user to be able to choose a file to open but when i call the OpenFileDialog before some function...
Read more >
Crash inside standard Open File Dialog
STR: Turn /LARGEADDRESSAWARE on in x86 application;Allocate more than 2 GB;Open standard Open File Dialog;Hover some folders or files to ...
Read more >
NDepend Release Notes
When attempting to browse a directory on a network drive not found, a Win32Exception could be thrown. Now an explanatory message box is...
Read more >
[Mono-bugs] Your Bugzilla bug list needs attention.
Build freeze when running make install - mono GenerateWsdl.exe . ... monodoc crashs with Unhandled Exception: System.
Read more >
FastReport .NET Programmers Manual
Select the report file that you just saved;. - select the WebReport component and clear its ReportResourceString property;. - select the "ReportFile" property, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found