System.Linq

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • hon123456

    System.Linq

    Why does the compiler say that 'Linq' does not exist in the 'System'
    namespace when specifying a using statement as follows:

    using System.Linq;

    ----


  • hon123456

    #2
    Re: System.Linq

    I try to add System.Core reference. But I cannot find System.Core
    reference in
    Reference of Visual Studio 2005. Please Help.

    Comment

    • =?ISO-8859-1?Q?Arne_Vajh=F8j?=

      #3
      Re: System.Linq

      hon123456 wrote:
      I try to add System.Core reference. But I cannot find System.Core
      reference in
      Reference of Visual Studio 2005. Please Help.
      VS 2005 is for .NET 2.0 - System.Core is new in .NET 3.5 - you
      should be able to find it in VS 2008.

      Arne

      Comment

      • hon123456

        #4
        Re: System.Linq

        On 4$B7n(B28$BF |(B, $B>e8a(B9$B; ~(B35$BJ,(B, hon123456 <peterhon...@ya hoo.com.hkwrote :
        Why does the compiler say that 'Linq' does not exist in the 'System'
        namespace when specifying a using statement as follows:
        >
        using System.Linq;
        >
        I am using Visual Studio 2005. Any method to Add System.Core. I know
        System Core is in .Net Framework 3.5. How can I add System.Core to
        Visual
        Studio 2005. Thanks.

        Comment

        • Jon Skeet [C# MVP]

          #5
          Re: System.Linq

          hon123456 <peterhon321@ya hoo.com.hkwrote :
          I am using Visual Studio 2005. Any method to Add System.Core. I know
          System Core is in .Net Framework 3.5. How can I add System.Core to
          Visual Studio 2005. Thanks.
          You can't. You need to use VS2008.

          (There may be some hacky way, but it's unlikely to be a good
          experience.)

          --
          Jon Skeet - <skeet@pobox.co m>
          Web site: http://www.pobox.com/~skeet
          Blog: http://www.msmvps.com/jon.skeet
          C# in Depth: http://csharpindepth.com

          Comment

          • =?ISO-8859-1?Q?Arne_Vajh=F8j?=

            #6
            Re: System.Linq

            Jon Skeet [C# MVP] wrote:
            hon123456 <peterhon321@ya hoo.com.hkwrote :
            >I am using Visual Studio 2005. Any method to Add System.Core. I know
            >System Core is in .Net Framework 3.5. How can I add System.Core to
            >Visual Studio 2005. Thanks.
            >
            You can't. You need to use VS2008.
            >
            (There may be some hacky way, but it's unlikely to be a good
            experience.)
            And if one has to ask about this, then it is not even
            worth trying ...

            Arne

            Comment

            • Oleg Polkovsky

              #7
              Reply: System.Linq

              I can suggest you an idea how to add the reference to System.Linq in a C# project. I'm not sure if it works in C# 2005, but it solves the problem in C# 2008.

              1) Launch the C# 2008 environment and create or open the necessary project.

              2) In the Solution Explorer section, find the node with the name of your project and right-click this node. A context menu will appear, and you have to choose the "Add Reference" option in this menu.

              3) You'll see a window called "Add Reference". It has some pages (".NET", "COM", etc.). The first page (".NET") must be opened.

              4) In the list below, find the component "System.Cor e", select it and click "OK".

              5) Now you may type "using System.Linq" link in the Code Editor.

              Comment

              Working...