Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Does not recognize System.Linq

I created this program and C# and it worked correctly a few weeks ago. Now, I copied all of this code to a another project I am working on. I added it to a brand new C# Class inside of the project I am working on. Visual Studio didn't recognize the assembly references that say "not found" in the comments.

This is just bizarre since they were found in the previous program. Does anyone know why Visual Studio can't find these assembly references.

using System;

using System.Collections.Generic;

using System.Linq;    //not found
using System.Text;
using XML_Creator;     //not found
using System.Xml.Linq; //not found
using System.IO;
like image 624
tennis779 Avatar asked Jul 09 '14 17:07

tennis779


2 Answers

An educated guess: It's probably the .NET framework target version of the new project.

System.Linq was introduced on .NET Framework 3.5.

Go to Project -> Properties -> Application and check the Target Framework property. It's probably a target framework prior to 3.5

like image 162
Adriano Carneiro Avatar answered Oct 09 '22 03:10

Adriano Carneiro


You need to add refrence to system.Core.

enter image description here

like image 33
Edwin O. Avatar answered Oct 09 '22 02:10

Edwin O.