问题描述
我有一个包含用户控件的项目。由于某些原因,使用该控件的窗口的设计视图已停止运行,并坚持使用无效标记-给出的错误是用户控件的某些成员未被识别或无法访问。但是,该项目可以编译并很好地执行。
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.
到目前为止,我已经尝试了典型的清理,重建,手动删除操作,在VS2010中将其加载正常,没有任何错误-即使在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(用于渲染设计器)也与XAML不同步,这也是一个问题在VS2012中。我刚刚发现了这一点,因为我在使用派生的用户控件时遇到了以下错误:
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 shadow cache is located in your user profile directory:
应用程序数据\本地\Microsoft\VisualStudio\11.0\Designer\ShadowCache
app data\Local\Microsoft\VisualStudio\11.0\Designer\ShadowCache
您可以删除其中的所有内容并重新启动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设计器无效标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!