Skip to content
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

Unhandled exception in MsBoxStandardView constructor #197

Open
David-A-Blankenship opened this issue Dec 9, 2024 · 0 comments
Open

Unhandled exception in MsBoxStandardView constructor #197

David-A-Blankenship opened this issue Dec 9, 2024 · 0 comments

Comments

@David-A-Blankenship
Copy link

Describe the bug
When creating a message box through MsBox.Avalonia.MessageBoxManager.GetMessageBoxStandard I get an exception that is originating in the Markdown.Avalonia.Markdown constructor. This exception is not caught and handled in either, resulting in it being passed back to my application. Here is the stack trace for this exception:

System.IO.FileNotFoundException: Unable to find the specified file.
at Interop.Sys.GetCwdHelper(Byte* ptr, Int32 bufferSize)
at Interop.Sys.GetCwd()
at Markdown.Avalonia.Markdown..ctor()
at Markdown.Avalonia.MarkdownScrollViewer..ctor()
at MsBox.Avalonia.Controls.MsBoxStandardView.!XamlIlPopulate(IServiceProvider, MsBoxStandardView)
at MsBox.Avalonia.Controls.MsBoxStandardView.!XamlIlPopulateTrampoline(MsBoxStandardView)
at MsBox.Avalonia.Controls.MsBoxStandardView.InitializeComponent(Boolean loadXaml)
at MsBox.Avalonia.Controls.MsBoxStandardView..ctor()
at MsBox.Avalonia.MessageBoxManager.GetMessageBoxStandard(MessageBoxStandardParams params)
at HanumanInstitute.MvvmDialogs.Avalonia.MessageBox.MessageBoxApi.ShowMessageBoxAsync(Window owner, MessageBoxApiSettings settings, MessageBoxMode mode)

It looks like this exception is originating the the Markdown constructor in a call to Environment.CurrentDirectory.

To Reproduce
Avalonia 11.2.1
MessageBox.Avalonia 3.1.5.1
.NET 8.0.7
Rocky Linux 8.9 64-bit

Unfortunately, I do not have good steps to reproduce this issue. One of my users is having this problem. I am not sure why the Environment.CurrentDirectory call is throwing this exception.

Expected behavior
I would expect that this exception is caught and handled in the Markdown object, but it could also be caught and handled in the message box object and have the message box displayed without the Markdown control.

Avalonia version
11.2.1

MessageBox.Avalonia version
3.1.5.1
OS
Linux

Additional context
I have also opened an issue in the Markdown.Avalonia project.
whistyun/Markdown.Avalonia#166

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant