7

I know similar questions exists but they don't address this exact problem.

I'm having an issue with Visual Studio 2008 SP1 whereby it hangs for 4-10 seconds whenever the xaml edit receives focus. It is literally driving me to despair and I'm about to move back to Winforms. Note - Just editing the straight up xaml (i.e no designer enabled) doesn't fix the issue.

I have done the following :

  • Disable the xaml designer
  • Disable all plugins Checked FileMon for activity during the hang (there is none)
  • Checked Disk / Paging for activity the hang (again, none)
  • Uninstalled Silverlight

Setup : Windows XP64 8 Core Zeon, 16Gb RAM

casperOne
  • 73,706
  • 19
  • 184
  • 253
headsling
  • 623
  • 3
  • 13

3 Answers3

5

The designer for XAML in VS 2008 is weak. Many of these issues have been addressed and dramatically improved in VS 2010 (even in beta 2).

I've started using Blend exclusively for designer-work, and just setup VS to use the XML editor (instead of the designer) for dealing with XAML files. This makes editing instantaneous within Visual Studio, although you need to swap out to Blend if you want a design time experience.

Reed Copsey
  • 554,122
  • 78
  • 1,158
  • 1,373
  • I've gotta say though, I was hoping for more in VS2010 - it's not that much better, imho. Still won't work for x64 builds, for one, and it's still quite slow - annoyingly slow. – Eamon Nerbonne Nov 24 '09 at 17:00
  • Weak is polite, Reed. And my new VS2010 crashes when I go to try out that new XAML designer on x64. Is there a reasonable alternative to throwing out $$ on Blend just to get an decent low-end dev experience? – Berryl Nov 24 '09 at 20:30
  • 1
    I think it's sad, but Blend is really the way to go. It's a pretty high end, polished designer experience. 2010 is okay, but you need to build targetting x86 (then it works okay, but not great). I agree the situation stinks, but that's really kind of the way it is... – Reed Copsey Nov 24 '09 at 21:35
  • 1
    I've found VS2010b2 just as bad for this. It takes a good 5-10 seconds to do the outlining (the bit that allows you to expand/colapse sections of code) every time a XAML window gains focus. – Cameron MacFarland Nov 24 '09 at 23:35
  • I'm amazed that 64bit support isn't there... i guess that i won't be downloading the beta then. Anyone know if this is going to change? – headsling Nov 25 '09 at 14:14
  • Well - after a week of trying to get this to work i've given up and gone with blend for my xaml editing. it's a horrible solution, but it's solving my problem for the mo. thanks! – headsling Nov 27 '09 at 15:29
  • Yes, I have used VS2008, VS2010, VS2010 SP1, and now VS2012 RC. It doesn't get better. In VS2012, it **DOES** get better in that if the XAML designer crashes, it is appropriately sandboxed so it doesn't crash the whole Visual Studio instance. It's good to be positive and uplifting and say that 'it gets better in VS2010', but the truth is, it doesn't get better. – Peter Seale Sep 04 '12 at 19:51
0

For me, the XML editor just didn't quite work right. What I did was in Tools/Options/Text Editor/XAML/Miscellaneous, activate "Always open documents in full XAML view." This prevents the IDE from trying to render your xaml at open and get right to editing your XAML. When you are ready to pay the render penalty, you can click on the design tab.

Because everyone knows writing xaml by hand is faster and more fun :)

Thomas
  • 3,348
  • 4
  • 35
  • 49
0

I had exactly same issue with XAML editor - every time I focused, saved, opened XAML code, the Visual Studio got stuck for few seconds.

For me the solution was removing reference to Microsoft.mshtml - I don't understand the reason (if someone does, please comment), but it really was the only problem and removing the reference solved my nightmare.

bretik
  • 717
  • 7
  • 15
  • interesting.. i just checked all my projects and i don't have a reference to this assembly. – headsling Jan 14 '10 at 13:24
  • 1
    Well.. Maybe it is not only Microsoft.mshtml reference, which is problematic. You could try to remove references one by one and see, if it has any effect to XAML code editor performance (in my case no restart or rebuild was required, adding/removing the reference had immediate effect). – bretik Jan 15 '10 at 03:16