locked
Visual Studio 2012 and Blend - Designer crashes editing Control Template after July 2012 Update

    Question

  • I just updated my copy of Visual Studio 2012 with the July 2012 update and now the designer is crashing when I try to edit the ControlTemplate of a custom derived control I created. The Designer was not crashing prior to the July 2012 update.

    Here's what I have to reproduce this:

    • Start a Blank Metro project in VS 2012 with July 2012 Update
    • Add a new item, a TemplatedControl
    • Derive your new TemplatedControl from something other than Control. In my case I used TextBox
    • Create a copy of the TextBox template and put it in Generic.xaml
    • Change the TextBox template to target your new template custom control you added
    • Use your custom control on a Page and then try to edit the current template of the control

    I have a sample project uploaded to my Skydrive that demonstrates the problem:

    EditTemplateFail.zip

    http://sdrv.ms/MSpvdS

    If I put the ControlTemplate in the Resources of the same page I use the control on, it works, I can edit the template. This is not acceptable because I'll have to duplicate this template on every page where I want to use it.

    How can I get this to work the way it used to work?

    Monday, July 23, 2012 4:29 PM

Answers

  • Thanks for reporting this issue. We can repro this on RC, but it looks to be fixed in our latest internal bits. You should be getting this fix in the RTM version of Visual Studio 2012.


    Dev@Mic

    Tuesday, July 24, 2012 5:42 PM

All replies

  • Hello,

    I downloaded your repro scenario and edited generic.xaml and customcontrol1.cs, selected mainpage.xaml.  Are there additional steps for us to get it to repro?

    much appreciated,

    mike

    Tuesday, July 24, 2012 4:24 PM
    Moderator
    1. Open the project
    2. Build the solution
    3. Open Generic.xaml
    4. Switch to Design View for Generic.xaml. Once the Designer loads, it will say "Generic.xaml cannot be edited in the Design View."
    5. Open MainPage.xaml
    6. In the Document Outline window (Ctrl+Alt+T or View...Other Windows...Document Outline), click the CustomControl1 node
    7. Right-click, select Edit Template -> Edit Current
    8. Visual Studio switches to Generic.xaml, which was already opened and in Design View, and in my case the Designer crashes and displays this:

    Tuesday, July 24, 2012 5:07 PM
  • Thanks for reporting this issue. We can repro this on RC, but it looks to be fixed in our latest internal bits. You should be getting this fix in the RTM version of Visual Studio 2012.


    Dev@Mic

    Tuesday, July 24, 2012 5:42 PM