locked
using System.Linq;

    Question

  • When i put using System.Linq; in my Console app, it says :


    Error    1    The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?)    C:\Users\Andreas\Documents\Visual Studio 2005\Projects\Cracker\Cracker\Program.cs    3    14 MyApplication. I have .NET 3.5 maybe this is problem. ( Windows Vista ).

    Help!

    Thanks

    Saturday, September 15, 2007 11:57 AM

Answers

  • Hi PiH,

     

    If you would like to integrate LinQ with VS.NET 2005, you need to install CTP LINQ Preview. Try to download it from this website - http://www.microsoft.com/downloads/details.aspx?familyid=1e902c21-340c-4d13-9f04-70eb5e3dceea&displaylang=en

    I tried to install it with VS.NET 2005 in my PC and found the reference assemblies was System.Data.DLinq, not System.Linq.

     

    If you would like to add a reference to System.Linq, I recommend you to install VS 2008 Beta 1 based on .NET 3.5. After done that, you can add a reference to System.Linq.

     

    Hope this helps,

     

    Regards,

    Citizens on the earth

     

    Monday, September 17, 2007 5:21 AM

All replies

  • Your answer is in the error message:

     

    "are you missing an assembly reference?" Add System.Linq to your references.

    Saturday, September 15, 2007 3:17 PM
  • Oh thanks, but when i put add references, i cant find system.Linq anywhere.
    Saturday, September 15, 2007 5:23 PM
  • To be able to use namespace System.Linq, you need to add reference to System.Core.dll. There are also other assemblies like System.Data.Linq.dll and System.Xml.Linq.dll, if you need them.

     

    Saturday, September 15, 2007 8:09 PM
  • Where can i find System.Core.Dll, System.Xml.Dll or System.Data.Linq.Dll? Do i have to download something?
    Sunday, September 16, 2007 8:45 AM
  • Hi PiH,

     

    If you would like to integrate LinQ with VS.NET 2005, you need to install CTP LINQ Preview. Try to download it from this website - http://www.microsoft.com/downloads/details.aspx?familyid=1e902c21-340c-4d13-9f04-70eb5e3dceea&displaylang=en

    I tried to install it with VS.NET 2005 in my PC and found the reference assemblies was System.Data.DLinq, not System.Linq.

     

    If you would like to add a reference to System.Linq, I recommend you to install VS 2008 Beta 1 based on .NET 3.5. After done that, you can add a reference to System.Linq.

     

    Hope this helps,

     

    Regards,

    Citizens on the earth

     

    Monday, September 17, 2007 5:21 AM
  • you have selected net framework lower than 3.0 i think. i select 3.5 and it works fine but if i select two it doesnt let me. try that.
    Saturday, October 04, 2008 12:59 PM
  • You are missing an assembly reference. To fix that ...

    Find the application in the Solution Explorer (little box in the upper right hand corner with the line  C:\...\websitename). Right click on that line and select Add Reference. In the box that opens up, under the .NET tab, scroll down to System.Core. Select it and click OK. Your web page or website will now build with using System.Linq. This will work for every page in the website, but if you start another website/project, you will have to add this reference again.


    Monday, March 15, 2010 8:29 PM
  • To make the LINQ functionality accessible, you need to make sure

    1. to have a reference to System.Core in your project (which is the case by default if you’re targeting .NET Framework 3.5 or later)

    2. and to have imported the System.Linq namespace in your code file.

     


    • Edited by Illegitimis Monday, October 03, 2011 7:47 AM
    Monday, October 03, 2011 7:47 AM
  • Use: 

    Imports System.Linq

    It solved my problem. System.Linq doesn't appear in the Add reference.

    Thursday, December 06, 2012 2:19 PM
  • System.Core.dll. can't be added as reference because its imported by default. If you create a project from one of the templates it will appear at the reference part of the project properties but is not available to be referenced when starting form a Empty project.
    Thursday, December 06, 2012 2:22 PM