本文介绍了Microsoft Ribbon无法在Designer中呈现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将Microsoft Ribbon用于WPF(System.Windows.Controls.Ribbon)和VS2015.由于我从项目中删除了不必要的依赖(例如动态数据显示等,与功能区无关的东西),因此它无法在Designer中正确呈现.所有RibbonButtons都将像通常的按钮一样呈现.等等.

我使用了清洁解决方案"选项,并且还多次重建,没有成功.虽然执行一切都很好,但只有设计人员无法处理功能区.是什么原因导致这种奇怪的行为?

这是我的功能区现在在设计器中的外观:

这是它应该看起来和之前的样子:

更新:当我在具有相同VS版本的另一台计算机上打开该项目时,一切似乎都很好.

解决方案

删除%LOCALAPPDATA%\ Microsoft \ VisualStudio \ 14.0 \ Designer \ ShadowCache无效,但这是这样的:

  • 封闭式解决方案(最多每个VS实例,您永远都不会知道)
  • 删除解决方案文件夹中的bin \和obj \(如今,清洁解决方案"还不够.为什么要这样做?如果VS做奇怪的事情,这是任何人都不会做的.也许我应该回到kill -9 devenv.exe && git clean -fX作为默认 m( )
  • 重新打开解决方案,并希望获得最好的结果.

这让我发疯了.唯一真正的Google命中此问题的地方就是这个SO问题,另一个没有任何答案的问题,500多个SO的伪镜像以及成千上万的误报...对不起.

I'm using thbe Microsoft Ribbon for WPF (System.Windows.Controls.Ribbon) and VS2015. Since I removed unnecessary depencies from my project (like Dynamic Data Display etc, things not related to the ribbon) it does not render correctly in the Designer anymore. All RibbonButtons get rendered as usual buttons and so on.

I used the Clean Solution option and also rebuild multiple times, without sucess. While execution everything is fine, just the designer can't handle the ribbon anymore. What could have caused this strange behaviour?

This is how my ribbon looks now in the designer:

And this is how it's supposed to look and looked before:

Update: it clearly seems to be a visual studio bug, as I opened the project on another machine with the same VS version and there everything is fine.

解决方案

deleting %LOCALAPPDATA%\Microsoft\VisualStudio\14.0\Designer\ShadowCache wasn't working but this:

  • close solution (at best every instance of VS, you never know)
  • delete bin\ and obj\ in solution folder ("Clean Solution" isn't enough nowadays. Why should it? It isn't anything anyone would ever do if VS is doing strange things. Maybe I should fall back to kill -9 devenv.exe && git clean -fX as default m( )
  • Reopen solution and hope for the best.

This drove me nuts. The only real google hits for this problem was this SO question, another one without any answer, 500+ pseudomirrors of SO and thousands of false positives... sorry for the rant.

这篇关于Microsoft Ribbon无法在Designer中呈现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-21 23:23