bluemoon6790
bluemoon6790

Reputation: 487

"No Suitable Method Found to Override" in Auto-Generated Code for Dataset

I am trying to add a Dataset (.xsd) to my Visual Studio project. I am referencing an existing database table.

I performed the following steps:

  1. Right-click Project in Solution Explorer panel.
  2. Click "Add Item".
  3. Select "Dataset" from the "Data" list.
  4. Drag table from Server Explorer to the blank Dataset designer page.
  5. Save the document.

When I save, I get several dozen errors like the following:

I tried deleting the Dataset and restarting from scratch and the same issue occurred, which means something in my workflow is causing this.

To compare, I opened a project that I built a few months with the same version of VS using the Dataset class and referencing the same database, and it has no obvious differences.

I also deleted the .vs folder from the project root, as that can sometimes cause reference weirdness.

There's not much to show code-wise, it's all auto-generated by VS, but the error above were copied out of the VS Error List panel.

I need help figuring out what settings/configurations I have set up incorrectly in Visual Studio that are causing this issue.

Upvotes: 1

Views: 778

Answers (1)

bluemoon6790
bluemoon6790

Reputation: 487

In case anyone else has run into this issue, Visual Studio 2017 doesn't always include all of the references/libraries it needs when using the wizard to set up a Dataset.

In my case, I had to manually add references to System.Data.SqlClient and System.Data.DatasetExtensions from NuGet, even though they were only used by auto-generated classes.

Upvotes: 1

Related Questions