1

I have imported external website into visual studio 2015. I am using .net 4.8. I am having trouble to import system.linq. It is saying "the type or namespace does not exist in the namespace system". I dont know Why does it not exist even I am using .net 4.8.

I have also tried to update to visual studio 2019 but same error occurs

using DAL;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;   /// here error is showing
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text.RegularExpressions;
using CsvHelper;
using System.Text;

the type or namespace does not exist in the namespace system

7
  • 2
    You need to add System.Linq as reference to your project. Adding a using at the top of a file doesn't automatically add the reference. Commented Sep 5, 2019 at 8:50
  • could you tell me how to add reference to the project? Commented Sep 5, 2019 at 8:52
  • System.Linq is part of .NET framework assemblies. Here a quick guide about how to add references to your project. Commented Sep 5, 2019 at 8:53
  • How did you import the site? Commented Sep 5, 2019 at 8:56
  • actullay I opened it from File->Open->Website Commented Sep 5, 2019 at 8:58

2 Answers 2

1

you have to Add System.Linq dll to your project

do this:

  1. right click on References in your project from solution explorer
  2. click on Manage NuGet Packages
  3. search System.Linq then click on Install
Sign up to request clarification or add additional context in comments.

Comments

0

The System.Linq namespace is in the System.Core assembly (in System.Core.dll). So, it is needed to put system.core.dll in references.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.