views:

1158

answers:

2

I've copied a Dataset from one csproj to another, and the new project gets the following compile warning: "The custom tool 'MSDataSetGenerator' failed while processing the file 'Client.xsd'."

In researching this warning I discovered that if I opened a VS cmd prompt and run XSD.exe on the xsd file directly I get more info. It says: "Error: Can only generate one of classes or datasets."

The command line flag that fixes this is to run: XSD /d {xsdfilename}

If I run that on the cmd line it generates the dataset code just fine. But I can't figure out how to make Visual Studio do that. Anyone know?

+1  A: 

I'm running into the same problem, and have found a manual workaround for this.

  1. Open the properties for the XSD file in your project.
  2. Remove the MSDataSetGenerator entry from the Custom Tool property.
  3. Re-add the MSDataSetGenerator value for the Custom Tool property.

When you paste the MSDataSetGenerator value back in and hit enter, it will regenerate the file it needs.

I'll be sure to post back here when I figure out a better solution.

Dan R
+2  A: 

The trick I've found is to delete (or rename to a temp file just to be safe) the name of the Client.vb or Client.cs file associated with the DataSet. That way when you add the file to the project, it'll detect the appropriate XML related data and generate a new class for you.

Dillie-O