Visual Studio无法识别System.Linq [英] Visual Studio Does not recognize System.Linq

查看:333
本文介绍了Visual Studio无法识别System.Linq的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了该程序和C#,几周前它可以正常工作。
现在,我将所有这些代码复制到了我正在处理的另一个项目中。我将其添加到正在处理的项目中的全新C#类中。 Visual Studio无法识别注释中显示为未找到的程序集引用。

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.

这很奇怪,因为它们是在上一个程序中找到的。谁知道Visual Studio为什么找不到这些程序集引用。

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;


推荐答案

一个有根据的猜测:可能是.NET框架的目标新项目的版本。

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

System.Linq was introduced on .NET Framework 3.5.

转到Project-> Properties-> Application并检查Target Framework属性。可能是3.5之前的目标框架

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

这篇关于Visual Studio无法识别System.Linq的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆