gpt4 book ai didi

wpf - 使用 WPF DataGrid 构建项目时出现 Visual Studio 2010 错误

转载 作者:行者123 更新时间:2023-12-02 10:47:03 24 4
gpt4 key购买 nike

我已将 C# 项目从 Visual Studios 2008 Professional 移至 Visual Studios 2010 Express。它使用 VS 迁移向导成功转换了项目,但构建失败。

有很多错误,都与 WPF Datagrid 有关。在VS2008中构建时不会出现该错误。例如:

'DataGridRow' is an ambiguous reference between 'System.Windows.Controls.DataGridRow' and 'Microsoft.Windows.Controls.DataGridRow' 

我发现该项目还使用了 WPFTools.dll。

使用VS2010也许不再需要WPFTools.dll?或者也许我需要使用专业版而不是 VS 的 Express 版本,并且项目未成功迁移?

我想我可以使用完整的命名空间编辑出现问题的所有位置,指定“Microsoft.Windows.Controls”或“System.Windows.Controls”,使错误消失,但我没有确定在 VS2008 下默认使用这两者中的哪一个。

最佳答案

这很可能与 .NET FW 版本有关,即...这是 3.5 之前的版本,您迁移到了 4 吗?如果是这样,您之前可能会使用 WPFToolkit,而 DataGrid 现在是 4 and greater 中标准固件的一部分。 。

删除对 WPFToolkit 的引用并使用标准 FW 类,应该没问题。

关于wpf - 使用 WPF DataGrid 构建项目时出现 Visual Studio 2010 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12964801/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com