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

查看:28
本文介绍了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 于 .NET 框架 3.5.

System.Linq was introduced on .NET Framework 3.5.

转到项目 -> 属性 -> 应用程序并检查目标框架属性.可能是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天全站免登陆