Visual studio 2012 XAML designer invalid markup

moreyummystuff picture moreyummystuff · Oct 13, 2012 · Viewed 13.9k times · Source

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?

Answer

dansan picture dansan · Nov 1, 2013

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!)