Tuesday, July 29, 2008

Visual Studio 2008 SP1 Beta XAML Designer Crash

UPDATE:  This issue is fixed in Service Pack 1 RTM as confirmed by a comment to this post from a MS Employee and myself testing it.

So I ran into this nice bug with Visual Studio Service Pack 1 Beta that prevented me from working with XAML designer. The exact error message is (also a screen shot at the bottom of the post):

Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)

So, I ran around and all I could find was other people having the same problem with no solution. I stumbled upon the solution though :) It's a simple workaround also...

  • Close all open files in your solution that contain any xml. This includes App.Config, .xaml files, .xml files, .xsd files, etc.
  • Close and reload Vistual Studio and immediately load a .xaml file and the designer will come up normally.
  • Make sure you close all files that contain xml content that aren't xaml designer files when you close the solution.
What does this mean? Well, for some reason if a xml content file is loaded before a xaml designer file then this error occurs. Hopefuly this will be fixed in the release of SP1.


4 comments:

Harley Pebley

Thanks! Ran into the same problem today and this fixed it.

nickl

Thanks Billy, I too had the same problem as I had Web.Config opened.

Nikola

Hello Billy,

I'm a Microsoft employee, working on the VS designer and saw your post recently. We fixed the issue you posted in the SP1 RTM.

I'm sorry for the trouble it caused you with the VS designer in SP1 Beta.

Thanks,
Nikola Mihaylov
Visual Studio Product Team

Clay

I am having this problem, I tried the recommendation here but still receive the designer error.

I am running VS2008 SP1, Vista Ultimate SP1, Silverlight 2 (Microsoft® Silverlight™ Tools for Visual Studio 2008 SP1)...

Any ideas?

Thanks,
Clay