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.

IOException when ParserSettings loaded in WPF App

See original GitHub issue

When 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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:17

github_iconTop GitHub Comments

1reaction
moh-hassancommented, Mar 6, 2020

The exception is handled by try ..catch and is not fired at Release Configuration. It’s caught and swallowed by setting Console.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.

0reactions
dos-isecommented, Mar 5, 2020

I can still reproduce this with version 2.7.82 Are there any updates? 2020-03-05_11h27_54

Read more comments on GitHub >

github_iconTop 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 >

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