C# – LayoutAwarePage does not exist in namespace VS2012 bug

cmicrosoft-metrovisual studio 2012

I'm trying to get a search contract working on my Win 8 app but after adding a search contract to my project I get the following namespace error:

LayoutAwarePage does not exist in namespace App1.Common.

I do have the correct namespace declarations in the xaml:

xmlns:common="using:App1.Common"

and the LayoutAwarePage is in the correct namespace App1.Common

Restarting VS2012 or doing a delete and rebuild doesn't help.
To replicate this problem try the following:

1) create new blank metro app

2) add references to Visual C++ runtime

3) add a search contract to the project (click Yes to automatically add other stuff like LayoutAwarePage etc)

4) rebuild and open SearchResultsPage1.xaml

If you follow the above steps you should see the error and also note that the SearchResultsPage1 does not display in the designer.

This problem only occurs when you add the reference to the Visual C++ runtime. Without this reference adding a search contract works fine!

Any ideas? What am I missing here? Can you replicate the issue using the above steps?

Best Answer

I just ran into the same issue.

Closing VS and deleting the relevant SUO file (in the folder of the solution, may be hidden) worked like a charm.