Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual studio 2012 XAML designer invalid markup

Tags:

I've got a project that contains usercontrols. For some reason, the design view for the window which uses the said controls has stopped functioning and insists on "Invalid Markup" - the error given is that some members of the usercontrols are not recognized or not accessible. The project however compiles and executes just fine. Loading it up in VS2010, the editor works fine, no errors whatsoever - the same even in Expression Blend.

So far I have tried the typical clean, rebuild, manually deleting stuff from obj, updating the .xaml and rebuilding, tried starting VS2012 with /resetuserdata and /resetsettings - the problem persists. I even rolled back to a much older revision of my project, back when the designer was working just fine, no dice - same error. I also tried launching VS2012 as a new windows user to avoid any stored appdata that might be lingering, again a no go.

Is there some other sort of cache or something that I could manually delete?

like image 764
moreyummystuff Avatar asked Oct 13 '12 08:10

moreyummystuff


Video Answer


2 Answers

There's also an issue with the ShadowCache (used for rendering designer) getting out of sync with your XAML in VS2012. I just found this out, as I was having a horrible time with the following error with derived user controls:

The local property XXXX can only be applied to types that are derived from YYYYY.

The shadow cache is located in your user profile directory:

app data\Local\Microsoft\VisualStudio\11.0\Designer\ShadowCache

You can delete everything in there and restart VS2012. After that, things worked much better (for at least a while!)

like image 141
dansan Avatar answered Sep 27 '22 17:09

dansan


Delete everything in ShadowCache

C:\Users\username\AppData\Local\Microsoft\VisualStudio\11.0\Designer\ShadowCache\

Copy-pasteable paths

Just copy/paste one of these paths into Windows Explorer. %LOCALAPPDATA% is a Windows Environment Variable it will be replaced with the corresponding value when entered into Explorer (also works in Command Prompt)

VS2012

%LOCALAPPDATA%\Microsoft\VisualStudio\11.0\Designer\ShadowCache\

VS2013

%LOCALAPPDATA%\Microsoft\VisualStudio\12.0\Designer\ShadowCache\

VS2015

%LOCALAPPDATA%\Microsoft\VisualStudio\14.0\Designer\ShadowCache\

ASP.NET

If you develop ASP.NET also delete

%LOCALAPPDATA%\Microsoft\WebsiteCache

%LOCALAPPDATA%\Temp\VWDWebCache

like image 39
pr0gg3r Avatar answered Sep 27 '22 17:09

pr0gg3r