c# GridViewColumns 缺少程序集引用

标签 c# visual-studio-2013 .net-4.5 assembly-references

我正在尝试在 Visual Studio 2013、.net 4.5 中使用“System.Windows.Controls.GridViewColumn”,但我收到此错误:

The type 'GridViewColumn' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.

在我的 Reference Manager 中,我在程序集选项卡下看到了这条消息:

All of the Framework assemblies are already referenced. Please use the Object Browser to explore the references in the Framework.

当我浏览时,我找不到“PresentationFramework.dll”。 这是类(class)的 MSDN:http://msdn.microsoft.com/en-us/library/system.windows.controls.gridviewcolumn(v=vs.110).aspx

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

我尝试添加 using System.Windows.Controls.GridViewColumn 但收到此错误:

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

编辑:

对于 WhyCry,当我按照您的建议进行搜索时,我仍然没有得到任何结果。 enter image description here 也许我需要使用不同的 GridView?也许 Windows.UI.Xaml.Controls

最佳答案

当您创建基于 WinRT 的 Windows 商店应用程序时,而此 GridViewColumn 控件是 WPF 控件之一。

WPF 和 WinRT 是互斥的,您不能在 Windows 应用商店应用程序中使用 WPF 控件。请阅读:Windows 8 Store Applications Vs. WPF Applications

关于c# GridViewColumns 缺少程序集引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25271865/

相关文章:

c# - 如何在 WPF 中打印表格

c++ - 如何使用 Visual Studio 创建源代码树外项目?

visual-studio-2013 - 是否可以将文件添加到 checkin 的 TFS 变更集中?

git - 禁用推送时如何通过 Visual Studio 将本地存储库同步到 TFS Git

c# - 使用异步数据读取器

c# - 设置日期时间格式

c# - 如何在子类的工厂方法中避免 switch-case

c# - mvc 4 底部的脚本 - 不在 View 页面中执行 <scripts>

c# - 所有 C# 强制转换都会导致装箱/拆箱

c# - HttpClient HttpResponseMessage 地址/URI