wpf VS 2012 的设计视图包含黄色警告图标
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13910921/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Design view of VS 2012 contains yellow warning icons
提问by Robert Strauch
I have created a WPF project in Visual Studio Premium 2012 which contains a MainWindow. This "imports" other user controls via XAML. The MainWindowis shown with warning icons and the following text. Unfortunately I don't have the English translation but it means something like this:
我在 Visual Studio Premium 2012 中创建了一个 WPF 项目,其中包含MainWindow. 这会通过 XAML “导入”其他用户控件。将MainWindow显示带有警告图标和下面的文字。不幸的是,我没有英文翻译,但它的意思是这样的:
This document contains one or more controls which have been changed. Rebuild the project to show the changes in the design view.
This document contains one or more controls which have been changed. Rebuild the project to show the changes in the design view.
Rebuilding the complete solution does not help. However these warnings do not have any effect.
重建完整的解决方案无济于事。但是,这些警告没有任何效果。
How can I get rid of these warnings?
我怎样才能摆脱这些警告?
回答by Robert Strauch
I have tried Asryaels solution which is as follows:
我试过 Asryaels 解决方案如下:
- Cleaning
- Rebuilding
- Saving all documents
- Closing Visual Studio
- Starting Visual Studio
- Cleaning
- Rebuilding
- 打扫
- 重建
- 保存所有文件
- 关闭 Visual Studio
- 启动 Visual Studio
- 打扫
- 重建
回答by Cami
When encountering the same problem, closing the solution, deleting the Debug and the Release folders in /bin and restarting the solution seems to have helped.
遇到同样的问题时,关闭解决方案,删除/bin中的Debug和Release文件夹并重新启动解决方案似乎有所帮助。
回答by Vojtana
I tried Asryaels solution, but it did not work for me.
我尝试了 Asryaels 解决方案,但它对我不起作用。
Did you switch your platform target? This happened to me when I had project under Platform target: Any CPU and switched to x64. When I switch back to Any CPU warning does not show anymore and control works properly.
您是否切换了平台目标?当我在平台目标下有项目时,这发生在我身上:任何 CPU 并切换到 x64。当我切换回 Any CPU 警告不再显示并且控制正常工作。
If you did switch platform target go to Configuration manager and create a new Active solution platform and for your project set Debug/Release to your project's current platform target. Worked for me.
如果您确实切换了平台目标,请转到配置管理器并创建一个新的活动解决方案平台,并为您的项目将调试/发布设置为您项目的当前平台目标。对我来说有效。
回答by Natthapol Vanasrivilai
This happens when the control within the ContentControl changes. You have to rebuild the solution to "update" the content within ContentControl.
当 ContentControl 中的控件更改时会发生这种情况。您必须重建解决方案以“更新”ContentControl 中的内容。
<ContentControl Grid.Row="0">
<view:View_UserControl_TitleBar/>
</ContentControl>

