Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LayoutAwarePage does not exist in namespace VS2012 bug?

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?

like image 707
Calanus Avatar asked Sep 13 '12 07:09

Calanus


3 Answers

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.

like image 169
Shahar Prish Avatar answered Oct 24 '22 18:10

Shahar Prish


You must add a reference to the WinRTXamlToolkit: From VS2012 Express

  1. Right click on the "References" item;
  2. Select "Manage NuGet Packages...";
  3. In the menu on the left in the new window select "Online" then "Windows & Packages";
  4. Search for the library named "WinRTXamlToolkit", select it then click on the "Install" button.
like image 12
PiApplications Avatar answered Oct 24 '22 20:10

PiApplications


Please close all tabs in VS if opened.

Then Click Build-> clean solution

next click build->rebuild solution

Now open the xaml file.

Hope it will work

like image 6
Ahamed Yaseen Avatar answered Oct 24 '22 19:10

Ahamed Yaseen