2013-05-27 92 views
2

我收到以下错误:Microsoft.Windows.Controls是否缺少程序集引用?

Error 26 The type or namespace name 'Controls' does not exist in the namespace 'Microsoft.Windows' (are you missing an assembly reference?)

这两个组件出现在.g.cs文件:

using Microsoft.Windows.Controls; 
using Microsoft.Windows.Controls.Primitives; 

当我删除它们,错误再次出现。

+0

您定位的是什么.net版本? Microsoft.Windows.Controls&Controls.Primitives自.NET 3.0以来。 –

+1

这些不是标准的命名空间名称。通常需要最小的repro XAML片段来诊断此问题。你需要检查一个简单的“hello world”项目,只需一个Window编译就可以了。 –

回答

5

检查您的XAML代码。可能会有xmlns指向Microsoft.Windows.Controls.PrimitivesMicrosoft.Windows.Controls

+0

谢谢我发现了风格的命名空间Microsoft.Windows.Controls.Primitives和Microsoft.Windows.Control,我删除它,它工作正常..谢谢亲爱的 –

相关问题