IOException when ParserSettings loaded in WPF App
See original GitHub issueWhen i use the Library in my WPF App (not Console App), there will be thrown an IOException in the Constructor of ParserSettings. It will be catched and DefaultMaximumHeight will be set. But it would, in my opinion, cleaner with that code:
try
{
if (Console.IsOutputRedirected || Console.WindowWidth < 1)
{
maximumDisplayWidth = DefaultMaximumLength;
}
else
{
maximumDisplayWidth = Console.WindowWidth;
}
}
catch (IOException)
{
maximumDisplayWidth = DefaultMaximumLength;
}
If you agree, i could do a pull request and merge it.
Best regards Lord_Pinhead
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:17
Top Results From Across the Web
Wpf LoadComponent throws IoException when try to load ...
I'm writing a windows application on .net 5.0. When I try to add something inside <Application.Resources> in app.xaml the application crash on ...
Read more >Exception when a WPF window is displayed
The crash symptom occurs when the application calls into the System.Windows.Application.LoadComponent method to load a XAML file, associated ...
Read more >Markup Xaml Parse Exception - C#
My WPF project throws xamal parse exception when it is run. this exception is thrown from main window when InitializeComponent method is called ......
Read more >Restore explicit main entry-point in code #3943 - dotnet/wpf
I have a few cases where I need to take control over app bootstrap: ... ability to get rid of App.Xaml to load...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The exception is handled by
try ..catch
and is not fired at Release Configuration. It’s caught and swallowed by settingConsole.WindowWidth=80
when redirected in WPF. In debugging, you can configure the debugger to ignore breaking on the First Chance Exception of IOException and it will ignore it (because it’s handled and not re-thrown again) using Debug > Windows > Exception Settings.This issue will be fixed in the next release.
I can still reproduce this with version 2.7.82 Are there any updates?