views:

229

answers:

6

Hello,

I've encountered a strange problem. I've installed "Visual Studio 2010 ultimate". While installing it showed that it sucessfully installed .NET 4.0. While installing some other softwares. They complain that .NET 2.0 is missing and asking me to install it.

How is it possible? .NET 4.0 must include .NET 2.0 right?

EDIT:

Now, I'm confused. According to this http://en.wikipedia.org/wiki/File:DotNet.svg CLR is part of .NET 2.0. Installing .NET framework 4.0 implies installing the entire stack. which also includes a .NET 2.0. Please clear this confusion.

+11  A: 

No. .NET 4.0 is a standalone CLR, it is NOT based on 2.0, unlike 3.0 and 3.5

Matteo Mosca
A: 

If i'm not misstaken, 2010 targets .Net 4.0 framework. Seems like your missing the .Net 2.0 framework on you computer.

Fredrik Leijon
A: 

as far as I know the CLR v2.0.50727 works above v4.0.30319

Kim Tranjan
A: 

Yes and no - you can run .NET 2 code on the .NET 4 runtime but they are separate runtime engines.

Depending on how the installer checks for .NET it must not be detecting 4 or maybe it's rejecting it as wrong: as ever it's safest to run code in the exact environment it was developed.

2/3.5 is a parallel install. I'd suggest you just install it - it shouldn't cause you any problems.

Rup
+6  A: 

.NET 4.0 is a new version of the runtime, it is independent of .NET 2.0.

New version of the framework don't encompass the previous versions, they are built as a specific version with a specific featureset. .NET 4.0 has a new runtime and newer BCL (base class library). The BCL essentially has all the same types as the .NET 2.0/3.0/3.5 BCL (albeit with possible breaking changes), and some new stuff. The two framework versions (v2.0 and v4.0) run side-by-side.

The fact that you haven't got .NET 2.0 installed is worrying as it's distributed through the Windows Update service. What OS are you using?

Matthew Abbott
Windows XP ____
pecker
Matthew Abbott
+3  A: 

As others have already said, .net 4.0 has a new CLR which is different from the .net 2.0 CLR.

By default an application will attempt to run on the CLR it was built against.

You can modify the applications.exe.config file with the <SupportedRuntime> element to explicitly tell the system which runtimes the application supports (The order specifies the preference):

<configuration>
   <startup>
      <supportedRuntime version="v2.0.50727"/>
      <supportedRuntime version="v4.0.30319"/>
   </startup>
</configuration>

(Obviously if there is something in your app that is dependant on something in .net 2.0 that has changed then this will still fail)

Unfortunately, if your application is failing to install, that's because the installer is checking explicitly that .net 2.0 exists rather than version>=2.0, if this is the case you could try looking for .zip downloads rather than installers, but other than that there isn't a lot you can do apart from installing .net 2.0 as well - side by side installs of multiple versions are fully supported.

Simon P Stevens