Cannot find using System.Data.Linq

后端 未结 5 828
面向向阳花
面向向阳花 2020-12-11 14:21

I\'m using C#, EF 4 in asp.net 4 and VS 2010.

I\'m trying to load namespace System.Data.Linq with this code using System.Data.Linq and I r

相关标签:
5条回答
  • 2020-12-11 15:04

    That namespace is LINQ-to-SQL, so you'll also need to add a reference to System.Data.Linq.dll; it won't be added by default just by adding Entity Framework.

    0 讨论(0)
  • 2020-12-11 15:07

    Right click your solution/project. Click Add Reference and search for System.Data.Linq and add the reference there and it should compile.

    0 讨论(0)
  • 2020-12-11 15:25

    Just to confirm that Adding the reference to the project didn't work for me because it was already selected.

    However, selecting "Copy Local, True" in the Properties pane for the reference made it start working.

    0 讨论(0)
  • 2020-12-11 15:25

    VS Installer

    The above answers didn't work for me, my problem was that I needed to add LINQ to SQL tools in Visual Studio.

    0 讨论(0)
  • 2020-12-11 15:27

    Try re-change target framework for your project.

    Go to Proporties > Application > Target Framework change to another than used now, and next change it back.

    0 讨论(0)
提交回复
热议问题