I am getting “defined in an assembly that is not referenced” errors when building my c# project, how to solve it?

后端 未结 2 1735
挽巷
挽巷 2021-01-29 09:48

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

1.The type \'System.ComponentModel.IListSource\' is defined in an assembly that is not referenc

相关标签:
2条回答
  • 2021-01-29 10:17

    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.
    0 讨论(0)
  • 2021-01-29 10:18

    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 讨论(0)
提交回复
热议问题