Well, I've heard of this bug before, but never had the unfortunate displeasure of experiencing it. Two days ago I started having problems when opening my Shell.xaml file, on a CWPF-based solution (hence the name, by the way). When I dbl clicked the xaml file, the split designer/xaml tab showed up, started loading the designer part (the usual message appears - "Press ESC to cancel") and suddenly, VS closed silently, discarding any changes I've made that far... Pretty neat huh? This has never happened to me before, and this xaml file had no special code written on it. In fact, as the name implies, it is just a shell for other views to use as canvas:
1: <Window x:Class="Client.Shell"
2: xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3: xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4: xmlns:cal="http://www.codeplex.com/CompositeWPF"
5: xmlns:infra="clr-namespace:Client.Infrastructure;assembly=Client.Infrastructure"
6: Title=Test Height="600" Width="1024" WindowState="Maximized">
7: <Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Background="LemonChiffon">
8: <ItemsControl VerticalAlignment="Stretch" HorizontalAlignment="Stretch" cal:RegionManager.RegionName="{x:Static infra:RegionNames.AppRegion}" Background="Azure" />
9: </Grid>
10: </Window>
I've read one workaround to this, wich was to create a new control or window. Well... The results were disapointing. Creating a new usercontrol or window also infamously crashed my Visual Studio. I started to get really pissed at this. It is really frustrating to work in these conditions.. One thing I've tried was to create a user control in another project in the solution, and in this test, everything went normally. Testing this again on the original project, problem remained. So, this is a local project symptom.
I started to wonder what this file had that was so special (or hated) to VS, for it to close so desperately! So I noticed the App.xaml, just sitting there so confortably for so long, and wondered what would happen if I opened it, since it isn't a visual file and only has Xaml. After clicking it, the xaml appeared in a hurry, no problem there. Then I immediately tested opening my Shell.xaml file again, hoping some internal refresh was made, and, to my surprise, it worked! From that point on, I had no more problems whatsoever.
Let this be a lesson to everyone who experienced this. Still haven't come up with a reasonable diagnostic to this, but I'll keep you posted af anything new comes up.