简体   繁体   English

您是否需要.NET 1.0框架作为.NET 1.0框架的目标?

[英]Do you need the .NET 1.0 framework to target the .NET 1.0 framework?

I have a bunch of .NET frameworks installed on my machine. 我的机器上安装了一堆.NET框架。
I know that with the Java JDK , I can use the 6.0 version to target 5.0 and earlier. 我知道使用Java JDK可以使用6.0版本定位到5.0或更早版本。

Can I do something similar with the .NET framework - target 1.0 and 2.0 with the 3.0 framework? 我可以对.NET框架做类似的事情吗-使用3.0框架实现目标1.02.0

Visual Studio 2008 was the first to support targeting older versions of .NET. Visual Studio 2008是第一个支持以旧版.NET为目标的版本。 Unfortunately, it supports only .NET 2 and up. 不幸的是,它仅支持.NET 2及更高版本。

In other words, you'll need .NET framework SDK 1 or 1.1 to do this. 换句话说,您将需要.NET Framework SDK 1或1.1来执行此操作。

We use Visual Studio 2008 to maintain a .NET 1.1 WebForms app using MSBee . 我们使用Visual Studio 2008使用MSBee维护.NET 1.1 WebForms应用程序。 It required a bit of initial *.csproj/msbuild file hackery, but works very well. 它需要一些初始的* .csproj / msbuild文件黑客,但效果很好。 Of course, you're limited to .NET 1.1 features (it uses the old 1.1 compilers), so no Generics or LINQ. 当然,您仅限于.NET 1.1功能(它使用旧的1.1编译器),因此没有泛型或LINQ。 But if you're wanting just one copy of Visual Studio installed it's the way to go. 但是,如果您只想安装Visual Studio的一个副本,则可以采用这种方法。

( Updated ) 更新

You need to compile with the 1.0 compilers. 您需要使用1.0编译器进行编译。 These are only available with the 1.0 release of the runtime/SDK. 这些仅在运行时/ SDK的1.0发行版中可用。

The 2.0/3.5 compilers won't emit 1.0-compatible assemblies. 2.0 / 3.5编译器不会发出与1.0兼容的程序集。

Visual Studio 2008 can generate 2.0 assemblies, but 1.0 was left off. Visual Studio 2008可以生成2.0程序集,但1.0保留了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM