Microsoft Ribbon doesn't render in Designer

2019-02-25 09:18发布

问题:

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.

回答1:

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.



回答2:

The problem was resolved by clearing the Visual Studio Designer Cache. This is done by deleting the subfolders in %LOCALAPPDATA%\Microsoft\VisualStudio\14.0\Designer\ShadowCache