George Hernando
George Hernando

Reputation: 2650

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.

Upvotes: 3

Views: 1001

Answers (1)

Aaron McIver
Aaron McIver

Reputation: 24723

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.

Upvotes: 4

Related Questions