none
Visual Studio take 40-50 % CPU when working in XAML files

    Question

  • Hi

    I have a problem that have suddenly startet. When I through Visual Studio 2013 open an XAML file the CPU goes to 40-50 percent for a couple of minutes and Visual Studio is basically unresponsive. When I have response from Visual Studio and start writing XAML code I can do that for about 30 seconds and sometimes a couple of minutes. When I then try to save the file Visual Studio locks up and is again unresponsive. It is Visual Studio that takes all the CPU and not the XAML designer that also runs as a process on the computer.

    I have changed my settings to full XAML editor so I don't use the designer by default.

    I have removed Visual Studio from forefront client security check.

    I have uninstalled Visual Studio 2013 and reinstalled and I still have the problem.

    I have no idea what to do.

    Best regards

    Jakob Brøckner

    Friday, November 13, 2015 8:11 AM

Answers

  • Hi Weiwei Cai

    Thank you for your reply...

    I actually found the solution (I think that was it) the other day. The problem was a difference between x:Class name in the XAML file and the Class name in XAML.vb file.

    E.g. the XAML file had x:Class="Form1" and the xaml.vb file class name was "frmForm1". I did not receive an error from Visual Studio but I guess a search was made in the entire solution for the "Form1" object. The VS solution consists of 7000+ classes and I guess thats why the Visual Studio took all the CPU and ... well locked up.

    I changed the names to match and the problem stopped.

    Best Regards

    Jakob Brøckner

    Thursday, November 26, 2015 10:09 AM

All replies

  • Hi JakobBinski,

    Is this problem just occurred with XAML designer? Is it also occurred with a common class file?

    Please check information in Output window, whether there any valuable information for this problem. First, please uncheck "Automatically adjust visual experience based on client performance", "Enable riche client visual experience" and "Use hardware graphics acceleration if available" options in menu "Tools -> Options -> Environment".

    If have disabled them, please check whether you have installed the latest update for Visual Studio 2013. My Visual Studio 2013 with Update 5 can reproduce the problem you described. Please install Update 5 from below link:

    https://www.microsoft.com/en-us/download/details.aspx?id=48129

    In addition, please close other third-part software when you running Visual Studio 2013, such as antivirus software.

    As far as I know, the XAML Designer performance is a bit slowly. Other communities has post there idea for this problem to User Voice and it has under reviewed by Microsoft. I suggest you also can add your comment for this idea.

    https://visualstudio.uservoice.com/forums/121579-visual-studio-2015/suggestions/2204137-improve-the-xaml-designer-performance

    Best Regards,
    Weiwei



    Monday, November 16, 2015 3:22 AM
    Moderator
  • Hi Weiwei Cai

    Thank you for your reply...

    I actually found the solution (I think that was it) the other day. The problem was a difference between x:Class name in the XAML file and the Class name in XAML.vb file.

    E.g. the XAML file had x:Class="Form1" and the xaml.vb file class name was "frmForm1". I did not receive an error from Visual Studio but I guess a search was made in the entire solution for the "Form1" object. The VS solution consists of 7000+ classes and I guess thats why the Visual Studio took all the CPU and ... well locked up.

    I changed the names to match and the problem stopped.

    Best Regards

    Jakob Brøckner

    Thursday, November 26, 2015 10:09 AM
  • Hi JakobBinski,

    I'm glad that you have figure out the problem. Thanks for sharing solution here. It will be benefit for other communities who has the same problem.

    If any question about Visual Studio IDE, please feel free to come back to our forum.

    Best Regards,
    Weiwei

    Friday, November 27, 2015 1:01 AM
    Moderator