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

Visual Studio Crashes or becomes unresponsive in Design View with HexEditor Control #100

Open
rblackmore opened this issue May 18, 2021 · 9 comments

Comments

@rblackmore
Copy link

Describe the bug
Visual Studio crashes or becomes unresponsive when using HexEditor control in WPF Designer view.

To Reproduce
I've tried a few different tests, but basically it seems to happen when using the control inside specific layout panels.
Steps to reproduce the behavior:

  1. Create Grid panel and place HexEditor inside, this works fine.
  2. Give the Grid Row or Column definitions.
    • Height/Width set to 'Auto' VS crashes or becomes unresponsive.
    • Setting to '*' seems to be okay, unless I use HexEditor in UserControl and then place UserControl on a Window.
  3. Same happens when using StackPanel.

Expected behavior
Designer should show HexEditor without Crashing.

Software Versions
=> Visual Studio Community 2019 v16.9.4
=> .NET: .NET 5.0, .NET Framework 4.8

Additional context
I've tried creating brand new projects, and a fresh install of VS on a couple Win10 VMs to eliminate issues on my PC, and it happens on all of them.
I also download the controls source code, and tried the Samples. These work fine, unless I change something about the layout panels, then VS crashes again.

Not sure if I'm doing something wrong. Perhaps this is similar to the following issue
#32 WpfHexaEditor.HexEditor causing Visual Studio, Application to lock up, spawning hundreds of threads

@abbaye
Copy link
Owner

abbaye commented May 18, 2021

Hello

Are you checked with sample project if it's work ?

I will check more at end of the day

@abbaye
Copy link
Owner

abbaye commented May 18, 2021

If you put the control over a new fresh windows it's crash also ?

@rblackmore
Copy link
Author

I have done some further experimenting, looks like it's caused by the HexEditor control not having default Height and Width Values.

Your Sample works fine, unless I swapped the HexEditor control over to a Grid.Row with Height="Auto". This caused VS Memory usage to continually increase and become unresponsive.

By giving the HexEditor a default size, this no longer seems to happen if the Gird or StackPanel it's in is trying to re-size to fit it's content.

You can check my fork here for changes I made.

It's a small change, and I'm not sure what else it may effect.

Would it be okay to submit a pull request? Sorry for asking, I have very little experience contributing to projects on github and I'm not familiar with common etiquette.

@abbaye
Copy link
Owner

abbaye commented May 20, 2021 via email

@abbaye
Copy link
Owner

abbaye commented May 27, 2021

Sorry I will check soon as possible. I hope this weekend.

@abbaye
Copy link
Owner

abbaye commented May 31, 2021

I can't reproduce you crash. Please update your visual studio it's can be fixe the problem

@rblackmore
Copy link
Author

Sorry for the late reply.

I'm running the latest VS 16.10.0 Community.
Generally, I don't think the XAML Designer should crash, or lock up if the UserControl doesn't have a default Height/Width, and most controls don't, for some reason this is happening to me.

I Do appreciate your time on the issue.
I have uploaded a very quick test project here, when Opening the MainWindow.xaml in designer, it will lock up.

As mentioned this is when it's placed into a grid.row with Height='Auto'

@abbaye
Copy link
Owner

abbaye commented Jun 10, 2021

Hi @rblackmore

You can't use hexeditor with Auto but you can with *... I will check what is cause this bug

But you can use like this:

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="*" />
        <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>

    <hx:HexEditor Grid.Row="0"/>
</Grid>

@timvz
Copy link

timvz commented Jan 29, 2022

I too have just noticed this issue. Any resolution yet? It's a great tool, otherwise!

It will also happen if I put the hexeditor control into a stack panel. Simply add a stack panel around the hexeditor control provided in the Sample project and the designer will freeze. I'm also using VS 2019.

Edit: Another workaround is to simply click the "Disable Project Code" button in the designer.

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

No branches or pull requests

3 participants