0
votes

I have already have references to System and System.Data.

1.The type 'System.ComponentModel.IListSource' is defined in an assembly that is not referenced. You must add a reference to assembly 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

2.The type 'System.Data.Common.DbDataReader' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

3.The type 'System.Data.IDataRecord' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

4.The type 'System.Data.Common.DbConnection' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

I have already have references to System and System.Data.

3
You have not referenced the above DLL's to your project that's whyhud

3 Answers

5
votes

Im going to drop my solution. I restarted visual studio.

4
votes

You need to add references to assemblies where there type are defines. To add reference to an assembly; right click on the Reference nodes under your project and select the assemblies node on the left tree and

  1. add reference to System.dll, which will show up as System on the right side
  2. add reference to System.Data.dll, which will show up as System.Data on the right side
0
votes

In my case I was getting error as

You must add a reference to assembly netstandard, Version=2.0.0.0

It was resolved by following steps

  1. In Visual studio - Solution explorer right click on the project and choose unload so that you are able to edit the .proj file.
  2. Locate the last tag of tags in side the t tag.
  3. After add an new tag as below:

   <ItemGroup>
    <Reference Include="netstandard" />
  </ItemGroup>
  1. Save the file.
  2. Again right click on project and choose Reload project.