1
votes

I'm trying to get RC of Visual Studio 2012 working for XAML files. I can't seem to get any XAML Intellisense and the option within Tools is greyed out.

I've also tried to run the solution using Blend, however I only get Intellisense for custom controls such as telerik then.

Partial Intellisense in Blend

When ever I drag controls onto the design surface I get an "Object reference not set to an instance of an object" exception but the control is still added to the surface.

I've read that this was a bug within VS11 and was fixed with in the Visual Studio 2012 RC.

I've created a new Silverlight Application and the intellisense is working so i'm wondering if its an issue with how my projects are set up.

I have all of my Styles within a separate themes project, which is referenced by other all other projects. Within the designer these references show up as errors but when the application runs they are resolved fine.

Would unresolved resources at design time affect Intellisense?

6
"Would unresolved resources at design time affect IntelliSense?" Yes, but it should only affect IntelliSense for types defined in the unresolvable assemblies or assemblies with types dependent on those unresolved assemblies. We have fixed several IntelliSense bugs for the next release of Visual Studio 2012, but if you wouldn't mind, we'd like to take a look at your solution (or a minimal repro, if you have one). If you drop me an e-mail at [email protected], I'd love to take a look.James McNellis

6 Answers

2
votes

Click "Build -> Clean Solution", then "Build -> Build Solution". ("Rebuild Solution" alone doesn't work.) [Source]

2
votes

If you have a reference to any of the expression blend dlls for interactions and you are using silverlight5 you will need to update the following dlls:

  • Microsoft.Expression.Controls.dll
  • Microsoft.Expression.Effects.dll
  • Microsoft.Expression.Interactions.dll
  • System.Windows.Interactivity.dll

Blend + SketchFlow Preview for Microsoft Visual Studio 2012 http://www.microsoft.com/en-us/download/details.aspx?id=30702

Ref Location: C:\Program Files (x86)\Microsoft SDKs\Expression\Blend\Silverlight\v5.0\Libraries

2
votes

Exact same problem here, using WPF.

In my case, removing:

<Page.Resources>
    <vm:AnyViewModel x:Key="anyViewModel" />
</Page.Resources>

Solve my problem...

0
votes

One known cause of XAML Intellisense failure is if System.Windows.Controls.Toolkit is one of the project references. I've seen where deleting that reference instantly fixes the problem. The problem is described in the comments of this Connect bug for VS2012 Beta, but it applies to the RC with the July update as well.

0
votes

I've found that some xaml designers for a control have this issue, where other controls are just fine.

The problem (in my case) seems to be if parameters are null or events call uninitialized singletons. Something the designer gives you a stack trace and other timers renders with no problem.

I've found by changing the back-end code for pages that don't have Intelli-sense to include DesignerProperties always fixes the issue (in my cases).

public Homing()
{
    InitializeComponent();

    if (DesignerProperties.GetIsInDesignMode(this))
        return;

    // some other code here that may have uninitialized members
}

t

0
votes

I'm not sure if I had the same problem, but Intellisense mysteriously stopped working for me within a XAML file. I tried cleaning the build as someone suggested, but that didn't work.

After I restarted Visual Studio 2013, the Intellisense in the XAML page started to work again.