Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Repeatedly losing XAML intellisense in Visual Studio 2010

I'm using Visual Studio 2010 to edit XAML for Silverlight (4). On a daily, or even hourly basis I lose my XAML intellisense randomnly.

Often I'll get a whole page of valid XAML smothered in blue underlines from Visual Studio 2010's parser getting confused:

alt text

Here is one of the errors:

Error 6 The type initializer for 'Microsoft.Expression.Platform.Silverlight.Metadata.FrameworkElementMetadata' threw an exception. C:\projects...\Styles.xaml

like image 614
Chris S Avatar asked Aug 16 '10 10:08

Chris S


2 Answers

I get this problem too, but it is intermittent at best. Visual studio is constantly re-compiling your XAML (and other code) behind the scenes and sometimes it will encounter an error, and that is where the problem is coming from. Sometimes it may be that there is no error, but VS decided to compile something while you were in the middle of typing a line. All I do is hit 'build' or 'rebuild' and everything works again.

like image 90
A.R. Avatar answered Oct 11 '22 23:10

A.R.


we had similar problem, could solve it by opening the xaml as source code for this, right click on the xaml and click open with. select source code editor without encoding. you may also want to set this as default behavior

like image 22
Babu James Avatar answered Oct 11 '22 22:10

Babu James