0

I have a user control that causes Visual Studio to constantly crash. I don't know why, and I'm tired of fighting it. I keep losing my work and having to kill all devenv instances as somehow it even it causes other VS instances to encounter issues.

It works fine at runtime. Is there any way to just disable Visual Studio from attempting to preview the element at code-time? As it is, it just shows an exclamation mark and says there was a problem generating a preview.

Mahmoud Al-Qudsi
  • 28,357
  • 12
  • 85
  • 125
  • If you're just looking to take it out of design time you could do something [like this](https://stackoverflow.com/questions/32872212/create-properties-that-only-apply-on-design-time) and just apply `Visibility="Collapsed"` as setter. – Chris W. Jul 10 '17 at 01:34
  • 1
    In the vein of what @ChrisW. suggested, you can easily hide an element at design-time only with the attribute `d:IsHidden="true"`. If you still want the element's placeholder to render, you can use @ChrisW's linked answer to replace the control's template with an empty `Border`. – Bradley Uffner Jul 10 '17 at 02:05
  • 1
    Another option may be to disable the XAML designer altogether: http://blog.spinthemoose.com/2013/03/24/disable-the-xaml-designer-in-visual-studio/ – mm8 Jul 10 '17 at 10:11
  • @ChrisW. @mm8 Does setting `d:IsHidden` or `Visibility=Collapsed` disable rendering or just hide the results of the render? – Mahmoud Al-Qudsi Jul 10 '17 at 15:56
  • Any one of them should work as far as I know to just not render the control. Bradley's is less intrusive and on per instance basis, and mm8's would allow you to avoid any of those issues for anything rendered incorrectly but still give you intellisense and stuff for editing like a text editor. So it looks like you have options :) – Chris W. Jul 10 '17 at 15:59

0 Answers0