45

How to disable XAML designer in VS 2011.

I have checked following links possible to default-disable XAML designer in VS 2008?

http://www.dolittle.com/blogs/einar/archive/2008/04/24/quot-disable-quot-xaml-designer-in-visual-studio-2008.aspx

http://weblogs.asp.net/alexeyzakharov/archive/2010/01/27/disable-visual-studio-xaml-designer-better-way.aspx

Problem with above is that intellisense also goes away with setting different text editor.

Community
  • 1
  • 1
Tilak
  • 30,108
  • 19
  • 83
  • 131
  • 2
    solution is very big and very slow. Any time i do some changes in XAML, solution hangs. – Tilak May 07 '12 at 13:35
  • If it is that big and slow you might want to see if you can prevent any 'constructor' code running in design mode. – Emond May 07 '12 at 13:59
  • Thanks. i will check that, yes there are lots of code in the constructor (and lots of logic call, that i am looking to optimize). But still i would like to know the way if designer can be stopped with maintaining the designer. – Tilak May 07 '12 at 14:07
  • Lots of code in the constructor is a bad thing for a designer. Logic belongs in the ViewModels. You could use System.ComponentModel.DesignerProperties.GetIsInDesignMode – Emond May 07 '12 at 14:11
  • I will also try this. This is new information for me. Most of the logic is in viewmodels. Some logic is in code behind (due to certain restriction/features of METRO style apps). – Tilak May 07 '12 at 14:19
  • In general I only add code to the constructors of the View that will load design time data. The loading of the ViewModels is only done at runtime – Emond May 07 '12 at 14:23
  • The last link you provide is the technique I use. It completely bypasses the XAML editor and intellisense still works for me. – Kent Boogaart May 07 '12 at 14:59
  • very limited intellisense is working. Only comments, CDATA, etc are coming. XAML intellisense is not working. – Tilak May 07 '12 at 16:17
  • 1
    BTW, the reason to disable the designer is here: https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/2204137-improve-the-xaml-designer-performance – Skrymsli Jun 08 '17 at 19:31

3 Answers3

80

In Visual Studio 2015 you can completely turn off the XAML designer in:

Tools->Options->XAML Designer\Enable XAML Designer

XAML Designer toggle location in Visual Studio 2015

Tor
  • 1,522
  • 3
  • 16
  • 26
Calin Pirtea
  • 1,079
  • 7
  • 11
  • 8
    The path is actually: Tools > Options > XAML Designer > Enable XAML Designer I also found that setting the "Default document view" to "Source View" was enough to stop my problems with the XAML designer. – Mark Bell Dec 21 '15 at 15:57
  • It works for Visual Studio 2019 as well. Restart required. – Trevy Burgess May 12 '21 at 20:29
26

For Visual Studio 2012 the Link "user1007074" provided (http://blog.spinthemoose.com/2013/03/24/disable-the-xaml-designer-in-visual-studio/) tells:

In the Tools –> Options menu, open the Text Editor node, then the XAML node, then select the Miscellaneous node; make sure that under the Default View heading there is a checkbox beside Always open documents in full XAML view.

also he suggest

Right-click on any .xaml file in your solution explorer and select Open With…

Choose editor and click "Set as Default". Many Thanks to David Alpert!

In Visual Studio 2015/2017/2019/2022:

  • In the Tools -> Options menu, open the XAML Designer node, then uncheck "Enable XAML Designer"

VS 2017 Options Dialog to set Default document view to Source View or to disable XAML Designer

As Mark Bell pointed out, it can be enough to set the Default document view to Source View, and leave XAML Designer enabled.

Dominique
  • 16,450
  • 15
  • 56
  • 112
gReX
  • 1,060
  • 1
  • 20
  • 35
  • This is also disabling my F12 (got to defintion) functionality – Incredible Jul 14 '17 at 10:31
  • @Iti Tyagi have you tried to set the Default document view to Source View, and leave XAML Designer enabled? See my updated answer. – gReX Jul 18 '17 at 09:17
1

This applies for VS2012, maybe also other versions:

In VS Installation rename XDesProc.exe to XDesProc.exe.bak

For me it was: C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\XDesProc.exe

This way it has the best performance gain. The process won't start and VisualStudio will show an undisturbing exception window instead of the designer.

Felix Keil
  • 2,344
  • 1
  • 25
  • 27