Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: Can only generate one of classes or datasets

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?

like image 760
dviljoen Avatar asked Dec 09 '08 17:12

dviljoen


1 Answers

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.

like image 90
Dillie-O Avatar answered Sep 30 '22 17:09

Dillie-O