C# 从 .NET 3.5 转换为 3.0

标签 c# .net visual-studio-2010

我不得不将我的程序从 .NET 3.5 降级到 3.0。我所做的就是进入 properties->application 并将“目标框架”从 3.5 更改为 3.0。这是正确的步骤吗?现在我收到警告:

我只有这个

using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using System.IO;

但是我明白了

Warning 1 The primary reference "System.Core", which is a framework assembly, could not be resolved in the currently targeted framework. ".NETFramework,Version=v3.0". To resolve this problem, either remove the reference "System.Core" or retarget your application to a framework version which contains "System.Core". ProgName1

Warning 2 The primary reference "System.Xml.Linq" could not be resolved because it has an indirect dependency on the framework assembly "System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v3.0". To resolve this problem, either remove the reference "System.Xml.Linq" or retarget your application to a framework version which contains "System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089". ProgName1

Warning 3 The primary reference "System.Data.DataSetExtensions" could not be resolved because it has an indirect dependency on the framework assembly "System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v3.0". To resolve this problem, either remove the reference "System.Data.DataSetExtensions" or retarget your application to a framework version which contains "System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089". ProgName1

Warning 4 The primary reference "System.Xml.Linq", which is a framework assembly, could not be resolved in the currently targeted framework. ".NETFramework,Version=v3.0". To resolve this problem, either remove the reference "System.Xml.Linq" or retarget your application to a framework version which contains "System.Xml.Linq". ProgName1

Warning 5 The primary reference "System.Data.DataSetExtensions", which is a framework assembly, could not be resolved in the currently targeted framework. ".NETFramework,Version=v3.0". To resolve this problem, either remove the reference "System.Data.DataSetExtensions" or retarget your application to a framework version which contains "System.Data.DataSetExtensions". ProgName1

最佳答案

警告告诉您这五个程序集是 .Net 3.5 中的新增内容,无法从 .Net 3.0 中引用。
只需删除这些引用即可。

关于C# 从 .NET 3.5 转换为 3.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10657500/

相关文章:

c# - 绑定(bind)命令以从集合中删除 self

c# - 会不会出现垃圾回收器因为异常而无法运行的场景?

c# - 如何根据键值对创建对象

c# - 在 Windows 应用程序窗体中调用 Web 服务

c# - DotNetOpenAuth OAuth2 访问额外数据

c# - .NET NodaTime 如何创建自定义时区?

c++ - 如何将 CMake 包含和库添加到 Visual Studio 解决方案?

.net - 在Visual Studio 2010解决方案级别定位特定版本的.NET框架

c# - Visual C# - 从另一个 *.cs 文件调用函数

c# - Selenium 网络驱动程序 : how to deal with javascript onclick in C#