Weird Visual Studio 2008 SP1 IntelliSense Issue Figured Out!

Ok, I just have to blog about this, because I just figured out an issue that’s been driving me nuts, nuts, nuts.

In some xaml files, I had no folding editor … and no IntelliSense!

What I discovered was that if I delete the local namespace declaration (and then add it back again), the folding editor starts working again.

Then, I discovered that if I just leave out the local namespace declaration … instead of adding it back, IntelliSense starts working again. Annoying … since I have to remember to put the namespace declaration back before checking it in.

So, I decided to do a search and see if anyone (besides me) had run into this problem. Well, as you all know, the trick to searching for anything on the internet is getting the right search string. Well, I got lucky. This search brought me to this blog post.

It wasn’t exactly my problem, but what I found was that if I added an ‘;assembly=’ to my local namespace declaration … everything started working again … and would continue working even if I closed and reopened the file! Woot! 😀

So, the following xaml doesn’t work:

<my:Inspector
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:my="clr-namespace:Snoop"
    x:Class="Snoop.PropertyGrid2"
    x:Name="PropertyGrid"
    MinHeight="0"
    MinWidth="0"
>

But, the following xaml DOES work:

<my:Inspector
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:my="clr-namespace:Snoop;assembly="
    x:Class="Snoop.PropertyGrid2"
    x:Name="PropertyGrid"
    MinHeight="0"
    MinWidth="0"
>

Hope this helps someone! It has bothered me for some time!

p.s.
Just to clarify: this does not affect Visual Studio 2010. That is, you do not need the ‘assembly=’ there … so this was likely an issue with the xaml editor in Visual Studio 2008.

Share