MahApps.Metro icon indicating copy to clipboard operation
MahApps.Metro copied to clipboard

Visual Studio 2013 hangs with MahApps.Metro projects during Start Debugging

Open evanwon opened this issue 12 years ago • 42 comments

In Visual Studio 2013, WPF applications that implement MahApps.Metro appear to freeze Visual Studio when initiating Start Debugging (F5). The freeze occurs after compile, and occurs as the application is being launched in Debug mode. If the application is launched without debugging (Ctrl+F5), this issue does not appear to occur.

This is an intermittent issue and unfortunately I don't have a repeatable method to initiate the error. However, in my experience, it occurs, on average, 1 out of every 3 attempts I make to Start Debugging (F5) a MahApps.Metro project in Visual Studio 2013.

When the freeze occurs, Visual Studio 2013 is completely unresponsive and must be forced close via the Task Manager.

I've found that if I close any open .xaml files (with the WPF designer) before initiating Start Debugging, the issue does not seem to occur.

This issue has been opened on Microsoft Connect by another user experiencing the same issue, and I thought it would be appropriate to raise it here as well, as perhaps this group may have some insight on what the root cause of the program may be.

Please let me know if I can provide any additional information!

evanwon avatar Dec 27 '13 20:12 evanwon

Oh, and I always thought this is because of the shitty VS Designer, didn't know that this only occurs in Mahapps.Metro... Let me See if I can geht a VS log tomorrow

flagbug avatar Dec 28 '13 02:12 flagbug

I've noticed this as well, but like flagbug didn't realise it only occurs when using MahApps.Metro.

grokys avatar Dec 30 '13 14:12 grokys

I have also noticed this issue yesterday. Seems that XAML designer hangs and VS freezes because of this.

QuantumDeveloper avatar Jan 19 '14 10:01 QuantumDeveloper

I have found a workaround (it works for me, but I don't know if it also works on other pc's, since it is a very, very strange workaround), also posted on the Microsoft Connect issue:

When I hover over the Visual Studio icon on the taskbar, the window thumbnails appear, just as usual. When I right-click the thumbnail of the hung Visual Studio window, the system menu appears. Also, the Visual Studio window immediately starts responding again, and the program launches.

Dotnetifier avatar Jan 20 '14 15:01 Dotnetifier

@Dotnetifier - Wow. That does indeed sound crazy but it actually works! :astonished:

grokys avatar Jan 20 '14 16:01 grokys

Any news about this?

All I can say is that for me (I think) it started to happen when I used circlebuttons with icons inside. Hope that is to any help.

rockafell-a avatar Feb 04 '14 16:02 rockafell-a

Oh my god. I also thought it was the xaml designer or resharper or something. I'll try the workaround next time it happens

@Dotnetifier Thanks a 1000x times, this bug was driving me nuts and your workaround works.

remcoros avatar Feb 04 '14 17:02 remcoros

@Dotnetifier If you haven't already, you should post this workaround onto the connect site's workaround section.

AzureKitsune avatar Feb 04 '14 17:02 AzureKitsune

I have posted it on the Connect site before I posted it here :) . I really am surprised that the workaround works for other people too, because it is just so crazy.

@rockafell-a I am also using Circlebuttons, with icons from the MahApps.Metro.Resources icons file. I will remove the circle button style, and see what happens...

Also, Visual Studio hangs when I edit the Application.xaml (VB.NET project, App.xaml in C# project I believe), so maybe the problem is in one of the themes or styles.

I hope Microsoft will soon respond to the Connect issue.

Dotnetifier avatar Feb 04 '14 19:02 Dotnetifier

@Dotnetifier @rockafell-a I'm not using circlebuttons with icons, but am still observing this issue.

evanwon avatar Feb 04 '14 19:02 evanwon

@evanwon Indeed, you're right. I removed all the Style="{DynamicResource MetroCircleButtonStyle}" tags, but I am still seeing the error.

Dotnetifier avatar Feb 04 '14 19:02 Dotnetifier

@evanwon alright, then it might not be the cause of this.

rockafell-a avatar Feb 04 '14 20:02 rockafell-a

Update 1 fro VS 2013 seems to solve this problem. At least I didnt face this error yet.

QuantumDeveloper avatar Feb 04 '14 20:02 QuantumDeveloper

I have Update 1 installed, but I still have the problem.

Dotnetifier avatar Feb 04 '14 21:02 Dotnetifier

I have update 1 installed as well, IT only seems to appear on more complex xaml files and only if you opened the designer for it. At least in my case.

I can't really reproduce it other then opening some random big xaml files. Hit debug, recompile, hit debug again.

Sometimes it works a few times, sometimes I (re)start visual studio and it would hang on the first time already.

The workround works for me though

remcoros avatar Feb 04 '14 21:02 remcoros

As much as I hate that you all have to deal with this, I am glad to hear that it's not just me experiencing this issue. I'll try the workaround!

amkuchta avatar Feb 04 '14 22:02 amkuchta

Freezes for me when I SAVE the project (which as we know precedes an F5)

Also If I have App.xaml open on a tab (not even tab selected) it nearly always freezes.

Helps if I close App.xaml & switch to MainWindow.cs (ie window xaml Design not on screen)

The workaround works only 50% for me (VS 2013 usually shuts down completely) as im hovering

tinmac avatar Feb 07 '14 15:02 tinmac

Hmmm, think I got it sorted (at least for me) Its not frozen all day, had an issue with a Flyout, heres what I did, in NuGet Moved from the 'loose' 'MahApps.Metro.Resources.Standalone' to 'MahApps.Metro.Resources'

tinmac avatar Feb 10 '14 18:02 tinmac

Guys, give CTP 1 of Update 2 a shot: http://www.microsoft.com/en-us/download/details.aspx?id=41699

AzureKitsune avatar Feb 10 '14 18:02 AzureKitsune

@Amrykid I didn't see any changes / fixes related to this in the release notes (http://support.microsoft.com/kb/2927432). Keep us updated though :)

remcoros avatar Feb 10 '14 18:02 remcoros