Visual Studio 2012 XAML 设计器无效标记 [英] Visual studio 2012 XAML designer invalid markup

查看:32
本文介绍了Visual Studio 2012 XAML 设计器无效标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含用户控件的项目.由于某种原因,使用上述控件的窗口的设计视图已停止运行并坚持无效标记" - 给出的错误是用户控件的某些成员无法识别或无法访问.然而,该项目编译并执行得很好.在 VS2010 中加载它,编辑器工作正常,没有任何错误 - 即使在 Expression Blend 中也是如此.

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.

到目前为止,我已经尝试了典型的清理、重建、手动从 obj 中删除内容、更新 .xaml 和重建,尝试使用/resetuserdata 和/resetsettings 启动 VS2012 - 问题仍然存在.我什至回滚到我的项目的一个更旧的版本,当设计师工作得很好时,没有骰子——同样的错误.我还尝试以新的 windows 用户身份启动 VS2012,以避免任何存储的 appdata 可能会挥之不去,再次不行.

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?

推荐答案

ShadowCache(用于渲染设计器)也存在与 VS2012 中的 XAML 不同步的问题.我刚刚发现了这一点,因为派生的用户控件出现了以下错误,我度过了一段可怕的时光:

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:

本地属性 XXXX 只能应用于派生自 YYYYY 的类型.

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:

应用数据LocalMicrosoftVisualStudio11.0DesignerShadowCache

app dataLocalMicrosoftVisualStudio11.0DesignerShadowCache

您可以删除其中的所有内容并重新启动 VS2012.在那之后,事情变得更好了(至少有一段时间!)

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

这篇关于Visual Studio 2012 XAML 设计器无效标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆