11
votes

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

3
Document what you see in the View + Error List window.Hans Passant
@Hans I'll try to track them, but often there's no errors at all, and intellisense will just stop.Chris S
I get this all the time. It drives me nuts. I've gotten into the habit of going to the code behind, using the C# intellisense, and then returning to XAMl. All in all VS2010 is pretty buggy I am finding, I eagerly await SP1.Matt Greer
Oh also Blend doesn't seem to have this problem, so sometimes I just head over there.Matt Greer
VS 2015 and still losing XAML intellisense all the time. Frustrating and non productive to say the least.usefulBee

3 Answers

5
votes

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.

2
votes

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

0
votes

Was having the same problem for a while now. Found that if I opened the xaml as source code and cleaned the solutions the complaints would go away.

enter image description here