简体   繁体   中英

Visual Studio 2010 errors on build of project with WPF DataGrid

I've moved a C# project from Visual Studios 2008 Professional to Visual Studios 2010 Express. It converted the project successfully with the VS migration wizard, but the build is failing.

There are quite a few errors, all having to do with the WPF Datagrid. The errors don't occur when built in VS2008. For example:

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

I see that the project also uses WPFTools.dll.

With VS2010 maybe WPFTools.dll is no longer needed? Or maybe I need to use the Professional version instead of the Express version of VS and the project wasn't successfully migrated?

I think I can edit all the places where this is a problem using the full namespace to make the error go away, specifying either "Microsoft.Windows.Controls" or "System.Windows.Controls", but I'm not sure which of the two it was defaulting to under VS2008.

This is most likely tied to the .NET FW version, ie...was this 3.5 prior and you migrated to 4? If so, you would have been using the WPFToolkit prior whereas the DataGrid is now part of the standard FW in 4 and greater .

Remove your references to the WPFToolkit and use the standard FW class and you should be fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM