Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can't add System.Linq reference to website application

Tags:

c#

asp.net

iis

I can't seem to fingure out why i can't add a reference to the .net namespace System.Linq. I used aspnet_regiis to check if i have the latest version of asp.net installed :

    C:\Windows\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis -lv
    2.0.50727.0    C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll
    4.0.30319.0    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll
    4.0.30319.0    C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll

I've also tried adding a reference to System.Core, but still i can't reference the System.Linq dll.

Also in my web.config, under

      <assemblies>
           <add assembly="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
      </assemblies>     

as iv'e mentioned before the refrences to System.Core and System.Data.Linq Exist in my website application : under Property Page -> references i could clearly see the exsiting refrences i added them again just in case and still i can't use the System.Linq or System.Linq.Data NameSpaces .

Any ideas how i could reference the System.Linq dll would be appreciated.

like image 782
eran otzap Avatar asked Dec 12 '11 01:12

eran otzap


People also ask

What assembly is system Linq in?

The System. Linq namespace is in the System. Core assembly (in System. Core.

Can we use LINQ in .NET core?

NET Core LINQ stands for Language Integrated Query. Language Integrated Query is one structured query that is used to retrieve data from the database and other different sources and formats. LINQ tutorials will assist you to find out the LINQ language using topics that go from basic to advanced.

What is System LINQ namespace in C#?

Linq namespace. It provides different type of classes and methods which supports LINQ queries. In this namespace: Enumerable class holds standard query operators that operate on object which executes IEnumerable<T>.

What is the use of using system Linq in C#?

Advantages of Using LINQ LINQ offers a common syntax for querying any type of data sources. Secondly, it binds the gap between relational and object-oriented approachs. LINQ expedites development time by catching errors at compile time and includes IntelliSense & Debugging support. LINQ expressions are Strongly Typed.


2 Answers

System.Core is the dll that the System.Linq namespace is in. As long as you have a reference to System.Core in your project you should be able to do

using System.Linq;

in any source file in whcih you want to use the Linq methods.

Check under References in the Solution Explorer. If System.Core is not there then:

  • Right-click References
  • Click "Add Reference..."
  • Choose System.Core from the .Net tab
like image 186
Andrew Cooper Avatar answered Sep 22 '22 23:09

Andrew Cooper


Make sure your Project is version 3.0 or higher.

Right Click on your project and then click add reference.

and maybe you are looking for this: System.Data.Linq

Check it here:

System.Linq Namespace

System.Data.Linq Namespace

Best Regards

like image 39
BizApps Avatar answered Sep 20 '22 23:09

BizApps