I recently started getting an issue opening any XAML file in the designer in visual studio. Visual studio would crash immediately. This then started to bleed over to crashing when trying to open the solution. I tried everything included reinstalling VS altogether. Didn’t work. When reapplying the Service Pack it downloads the Silverlight Developer tools from the internet. This version is 4.0.60531 which appears to be the culprit. Colleagues have an older version and have no issue. The error in Windows Event Viewer was fault in module agcore.dll. After a quick google i found this post with others having the same issue. The solution was to unregister System.Windows from the GAC. Presto. Works.
Hi Trent,
I just did that, unregistering the system.windows from GAC. But all i wonder is, it all of a sudden started giving trouble since today though i doubt that system.windows must exists in the GAC quiet long. I then started doubting the fix but didnt have any other solution though.
some posts says to use “ngen /delete *” command from VS command prompt, from this post (http://blog.palehorse.net/2009/04/28/how-i-fixed-visual-studio-crashing-when-opening-xaml-wpf-files/). after doing this, are you able to open xamlx files in VS2010? debug inside them?
Okies. Just tried and checked this. For no reason, i could not understand when & why the “system.windows.dll” went to GAC. If this is by system, then why are we removing that from GAC just for VS2010 to work? all these questions raised in me, and once i removed the dll from GAC, i went back around it, added that same dll from the SL version folder into GAC back. Closed my VS2010 and re-opened, tried opening the XAML files. Lucky so far! 🙂