I have a bunch of .NET frameworks installed on my machine. I know that with the Java JDK, I can use the 6.0 version to target 5.0 and earlier. Can I do something similar with the .NET framework - target 1.0 and 2.0 with the 3.0 framework?
(Updated)
You need to compile with the 1.0 compilers. These are only available with the 1.0 release of the runtime/SDK.
The 2.0/3.5 compilers won't emit 1.0-compatible assemblies.
Visual Studio 2008 can generate 2.0 assemblies, but 1.0 was left off.
@Frank Krueger: I don't know what that means. Does the .NET 3.0 framework have the 1.0 compilers?
Visual Studio 2008 was the first to support targeting older versions of .NET. Unfortunately, it supports only .NET 2 and up.
In other words, you'll need .NET framework SDK 1 or 1.1 to do this.
Can you explain what you mean by targeting one framework with another framework? You can run apps which are targetted at an older framework on a newer framework, if that's what you mean.
(And by the way, 3.0 and 3.5 are both actually 2.0 + Extras)
So I can just leave 3.5 installed and compile for 2.0 and 3.0, along with 3.5, using VS2008? Thanks.
Can you explain what you mean by targeting one framework with another framework? You can run apps which are targetted at an older framework on a newer framework, if that's what you mean.
In Java, you can say that you want to target Java 5 or Java 4 or so on, and generate class files that can be executed by that version of Java, regardless of what JDK you use to make the class files. I'm only running JDK 6, but I can easily make a class file that you can run if you only have JDK 4 on your machine. That's using JDK 6 to target JDK 4.
We use Visual Studio 2008 to maintain a .NET 1.1 WebForms app using MSBee. It required a bit of initial *.csproj/msbuild file hackery, but works very well. Of course, you're limited to .NET 1.1 features (it uses the old 1.1 compilers), so no Generics or LINQ. But if you're wanting just one copy of Visual Studio installed it's the way to go.