YAFLogo

Dimi
  • Dimi
  • 100% (Exalted)
  • YAF All-the-Time Topic Starter
14 years ago
Does anybody know if it's possible to combine .NET 2.0 and 4.0 in one solution? I found an explanation on the Internet that it was possible up to 3.5, then the CLR was completely changed and 4.0 uses a different incompatible version of CLR. As a result, calling .NET 2.0 assemblies from .Net 4.0 assemblies and applications is totally impossible until we add a COM+ wrapper. Is that true? Or someone knows how to avoid that? The question appeared after I tried to add bin files from the latest installation compiled for .NET 2.0 to my .NET 4.0 solution to use the forum as a page control. The idea completely failed. Although I can recompile the solution to 4.0 I showed in another thread that this way also has traps. So I'd prefer to use the pre-compiled .NET modules.
Dimi

UserPostedImage

Sponsor
pcmantinker
14 years ago
The best way to have two versions of .NET running in your web application is to have two web.config files. In the main web.config, make sure that you have this tag enclosing your section(s) that you don't want .NET 2.0 to see:

<location path="." inheritInChildApplications="false">
</location>

This is assuming that .NET 4.0 is running your parent web application and that .NET 2.0 is your child application. I don't think that .NET 2.0 has the tag "location" built into its web.config parser. You would need another method to handle .NET 2.0 in your website if it's the parent application.

Andolasoft
14 years ago
As an exercise, I'm going to list out my Programming Language Migration Path. I would be interested to hear from other programmers what their PLMP is as well.