Visual Studio 2012 XAML Designer hangs often - wpf

I have a serious problem with Visual Studio 2012 XAML Designer that hangs often in these situations:
Editing in designer and then edit a value in text editor or vice versa (often)
Copy/paste operations (in text editor, specially with ResourceDictionary items) (very often)
Change to another XAML document (unusual)
The only solution I have is killing xdesproc.exe process in Task Manager (if I don't do this, it would take over 15 minutes to be working again), but if I have a lot of XAML files opened I need to reload the designer wasting some time because the text editor hangs too when is loading.
Is very annoying, and I didn't have this problem with Visual Studio 2010.
What could be a viable solution for this issue?

http://social.msdn.microsoft.com/Forums/en-US/cb7d638b-64ea-4e5a-b926-081b6abf1e58/xaml-editor-in-vs-2012-is-really-slow-and-locks-up-a-lot -googled a bit and found this

Related

How do I fix DPI scaling issues for Visual Studio 2017 Windows Forms

I've been encountering this issue ever since I bought this laptop with 4k display in 2015. With a lot of effort I managed to work around the issue but I'm growing tired of it.
VS2017 is supposedly DPI aware hence I do not expect any issues when creating a simple MDI Parent Form and running the app. But to my frustration the icons in the toolStrip (just the standard one in the MDI parent form) are scaled horribly.
When I create a form with a button on it which looks just fine in Visual Studio 2017 designer and I run the app and load the form, the button text isn't completely shown.
My display settings are as follows:
Resolution: 3840x2160
Scaled 250% (in display settings) because at 100% everything is unreadable
I've tried to find solutions, but the only workable thing I could find was setting my visual studio designer to dpi-unaware via registry (link here)
Help anyone?
Update When I add a new MDI form with the setting of DPI-awareness OFF, everything looks OK except Visual Studio itself (blurry).
I have similar problem when working with Windows Forms (Windows Forms Designer) on Visual Studio 2017, but I think it would be the same on Visual Studio 2019.
From Microsoft documentation here, there is a tip to disable the scaling/DPI aware feature.
If you prefer to manage settings from the command line, devenv.exe
takes /noscale as a command-line parameter to run in 100% scaling
mode.
So, basically, I just created a shortcut on the Desktop to Visual Studio (devenv.exe) and added the parameter /noscale on the shortcut Target field like so:
"...\path\to\IDE\devenv.exe" /noscale
So, everytime Visual Studio is started through the shortcut, it will always start with 100% scaling mode. If you use high resolution screen (high-dpi) screen, you will notice that the Visual Studio text will appear a little bit blurry because of this.
You should change the settings so there won't be a difference when the program runs on different machines.
Go to the project's properties page, then to Manifest Tool and then Input and Output. Change the DPI awareness to 'none'

Visual Studio 2013 Extremely Slow at Saving Files

I have a WPF project where it sometimes takes extremely long time to save a module.
(I see the little saving floppy pulsating "forever" and nothing happens for several minutes).
Often I have to use the Task Manager to end Visual Studio and then start over again.
The first couple of times after restart, saving is pretty quick, but then it takes forever again.
Any hints to solve this problem would be very much appreciated.
Problem fixed in Tools->Options->Source Control, by setting the source control plug-in to "None", which is fine as we are not using TFS or Git for the project. Not sure why this works, but Visual Studio does not "hang" after this change.
Here are some steps you can follow to increase the performance
Go to a xaml file via solution explorer. Right click open with..Choose Source Code (Text) Editor and Set as default.
Sample
Go to Tools > Options > Text Editor > XAML > Miscellaneous and check the check box "Always open documents in full XAML view".
Sample

VS 2012 hangs on loading XAML designer

We do MVVM and use DI in our WPF project. Now we are working on VS 2012. Whenever we open the views (XAML forms) the XAML designer shows the loading message. Then whenever we try to change the XAML code panel VS hangs (While it is froze on loading message). XDesProc.exe takes about 13% of CPU (As I have 8 cores so it takes 100% of a core). When I close it, VS goes out of halt. But if you change the XAML code the scenario will be repeated again.
We didn't have any problem with VS 2010 in the same situation.
What is wrong?
A work-around is described in this thread:
Visual Studio 2012 hangs on editing XAML
To summarise you can make VS not use the XAML designer, and just use the regular source editor:
Right-click on a XAML file in the Solution Explorer
Select "Open With..."
Select "Source Code (Text) Editor"
Click on "Set as Default"
Click OK
You're done!
I have the same issue on one of my views. It is not really a solution but i noticed that, when I comment out the DataContext Property, the cpu load is gone.
Open Xaml file (cpu load is rising)
Comment out DataContext property with viewmodel binding
Kill XDescProc.exe in TaskManager
Reload Designer (no cpu load)
Try installing the latest update to Visual Studio Update 1. If after the update it still occurs submit the issue to Microsoft Connect.
Make sure you that, if you have any code in the constructor or any other code that might execute in the designer, you detect the design mode and do not execute that code.
You might be connecting to a data source and the designer might be choking on that.
See: Is there a way to check if WPF is currently executing in design mode or not?
Our computer's VS2012 has updated to Update 4, but it is still hangs on loading XAML designer..

Visual Studio 2010 - XAML Editor Extraordinarily Slow

Has anyone else experience incredibly slow performance in the XAML editor in VS 2010? If I have a new project with a limited number of files, the performance is fine. However, if I have a project with a larger number of XAML files, the XAML editor hangs intermittently every few seconds, making it almost impossible to use.
I should also note that the performance is only slow in one particular project where I am referencing DevExpress 2010. I am not certain if this is related.
Any suggestions on solutions to this problem would be greatly appreciated.
Chris
In Visual Studio 2012:
Go to
Tools > Options > TextEditor > XAML > Misc
Check Always open documents in XAML view and uncheck Automatically populate toolbox items.
In Visual Studio 2015, 2017:
Go to
Tools > Options > XAML Designer
uncheck Automatically populate toolbox items.
This fixed my same problem.
If you don't need the visual designer, you can select a different editor in visual studio:
Right click the xaml file -> Open With... -> Source Code (Text) Editor
You will only lose the split view, intellisense etc. should still work.
If you need to check something in the designer you can still click 'view designer' to open the normal XAML editor again.
If you want to improve the performance of the visual designer, try checking DesignerProperties.GetIsInDesignMode in your code-behind. The visualiser instantiates your controls to know how to display them, thus executing parts of the code-behind.
Like the OP, I had extreme lag in the xaml editor on a project that relied heavily on DevExpress WPF controls. After trying unsuccessfully to resolve this issue with the other solutions posted here, I eventually tried deleting my Solution User Options (.suo) file, which is usually located in the same folder as the solution (.sln) file. This immediately resolved the issue. You may want to read this post about what visual studio stores in the suo file so you can reset anything important (such as build configuration - mine always defaults the active solution platform back to "Mixed Platforms" for example)
Short answer: if you do not use designer much, just replace the default editor for XAML, thus getting rid of XAML visual designer and speeding things up. Right click any XAML file, click Open with... and choose another default editor. Source code (text) editor works just fine.
Now it should be already fine. If you want to understand the details and completely get rid of the slow designer, read the long answer.
Long answer: Here is a nice explanation of what happens and why is it that slow.
A brief todo based on the aforementioned article in order to completely disable the visual designer of XAML:
Under Tools->Options->Text Editor->XAML->Miscellaneous->Default View check Always open documents in full XAML view
Open Task manager and end XAML Designer process XDesProc.exe (Note: for VS2013 right click this process and go to containing folder. Rename the exe to sth else, than end the process)
Standard XAML editor will load this process again (I guess it will not succeed with VS2013 and actions done in P.2). However, right click any XAML file, Open with... and choose another default editor. Source code (text) editor works just fine.
While using dev express, I've noticed some laggy response in the Visual Studio designer. This appears to be due to the license authentication of the DevExpress products.
If you delete the "Licenses.Licx" file (found in the project properties folder) you'll notice a marked improvement in performance.
Note: Removing the license file doesn't stop you from using DevExpress controls. But it does stop VS from constantly authenticating it.

Visual Studio 2010 WPF Designer issues

I am using:
Visual Studio 2010 Professional,
Silverlight 4 Toolkit
The WPF Designer don't show (invisible) - while the Component Toolbox is showing the relevant controls, and the Windows->Windows option shows the designer to be active. It does this with ALL XAML for me, regardless of its complexity. I have already tried the /ResetSkipPkgs to no avail. I had CodeRush and DevExpress installed (demo) version but removed both since. I can get along with XAML by switching to Source Code /Text Editor, but this really boils my chops to run the app to find out that I have made a silly mistake in my XAML (while a preview would sort it out quicker, and no, please don't suggest Expression Blend for it is non-nonsensical for me to switch continuously between these applications).
When I however switch the WPF Designer to open with Encoding I get the following error - which I assume is related to the issue for not showing the XAML Editor/Designer in non-encoding:
An Unhandled Exception has occurred
Click to reload the designer
System.NullReferenceException
Object Reference not set to an instance of an object.
at MS.Internal.Providers.VSDesignerContext.VSDesignerContextHolder..ctor(IServiceProvider services, VSDesignerContext context, Object docData)
at MS.Internal.Providers.VSDesignerContext.GetContext(IServiceProvider services, IVsWindowFrame frame, Boolean createIfNotExist)
at MS.Internal.Designer.TabbedEditorPane.MS.Internal.Designer.ITabbedEditorService.get_DesignerContext()
at MS.Internal.Designer.DesignerPane.InitializeDesigner()
I have googled it silly, to no avail. I am thinking about reinstalling Visual Studio - but this REALLY is a last resort. I hate fixing things by reinstalling, rebooting etc.
Any guru with the magical answer?
I got the exact same exception today and solved it by killing a few GDI hungry apps. You can see the number of GDI objects a process is using in the Processes tab of Task manager (you will probably need to add the column using View -> Select Columns).
Hmm, I know this is old, but you should try installing SP1 for your Visual Studio if you haven't yet.

Resources