C#/XAML Compile Error – Various Errors (The name “LayoutAwarePage” does not exist”)
Not a good night. After all my progress my Visual Studio 2012 Project for Accountable has bugged out and I get the following error:
Error 5 The name “LayoutAwarePage” does not exist in the namespace “using:Accountable.Common”. G:\Coding Projects\Visual Studio 2012\SAVED\Accountable\Accountable\BasicPage1.xaml 1 1 Accountable
Weird, as all I have been doing is adding new XAML Views to the project, them bamn, Visual Studio has bugged out. So I furiously last night tried the following:
- Had a look on StackOverFlow and found post which didn’t help at all. I then logged my own here ONLY after trying the following triage on my Project:
- Deleted the SUO (Hidden) file from the Solutions folder. No luck.
- Removed my XAML Files, Classes (Models and ViewModels) and deleted the Common Classes and created a new XAML Basic Page. This causes the Project to reload the Common Classes (including LayoutAwarePage.cs). Rebuilt the Solution, no luck.
- Removed the reference Syncfusion Controls for WinRT XAML which I use for Custom DatePickers. Still the same issue.
- Repaired the Visual Studio 2012 installation using Control Panel->Program Features->Visual Studio 2012->Change. Again, nothing happened.
The (very helpful) guys over on Stack couldn’t resolve the issue as well, plus I created a new Project and this works, so i logged a call on Microsoft Connect here:
As you can see, not very helpful! So I’m now left with no option but to create the Project again, and add it bit-by-bit up from existing code. Hopefully the issue doesnt replicate BUT if it does, I might be able to isolate and provide more detail. For the time being I will keep the SO question open. If anyone else gets this issue, comment here or post on the SO question.





Is definitely a bug in VS/Blend. I have the same error, but i can compile and run the App without Problems. I hope MS will fix it soon.
I believe I have the same issue. I made very minor additions to my code (just added a class and a few subs) then suddenly was unable to compile and got over 100 errors that all seemed to stem from the project ‘forgetting’ the LayoutAwarePage. I too tried the same troubleshooting you did. I haven’t tried a VS repair yet, but I’m not confident.
I of course removed the changes I had made since the project last successfully worked and I double checked all my namespaces, etc. even though no changes were made to them.
I was expecting to put the finishing touches on my app today and publish it!
I might have to do a file-by-file recreation of my project. Sounds like fun.
The Visual Studio repair didn’t work for me at all. What I found was by removing a Visual Studio update, the issue has resolved itself. I’m in the process of rebuilding file by bloody file!! Good times……..:’(