2

Is it possible to host a .NET 4 application under a .NET 2 site?

For several reasons we have to run the main site on .NET 3.5, but there is an application written in entity framework 4, which hosted under the same domain/port.

When I try to add an application under the site (using a different .net 4.0 application pool), i get an error stating duplicate content in web.config. I have searched the net for fixes, but none of them seems to be working for me.

I am running a Windows Server 2008 R2 with IIS7.5

Any help would be appreciated.

Bit Hunter
  • 849
  • 1
  • 6
  • 8

3 Answers3

2

It is possible to fix, if you carefully read Microsoft's document,

http://msdn.microsoft.com/en-us/library/a99txfy5.aspx

and

http://www.asp.net/whitepapers/aspnet4/breaking-changes#0.1__Toc256770150

Lex Li
  • 60,503
  • 9
  • 116
  • 147
1

No, that's not possible. An assembly compiled against .NET 4.0 must be run inside CLR 4.0. It is possible the other way around: run an assembly compiled against .NET 2.0 inside CLR 4.0.

Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
0

No, the nested application will not be able to set a seperate framework version. I would suggest changing the version on the main site to v4. I don't think you should experience problems running a 3.5 app on version 4. What are your reasons for running it in 3.5?

robasta
  • 4,621
  • 5
  • 35
  • 53
  • The application running on .NET 3.5 is a conjuncture of several third-party frameworks, when i tried to change the .net version i ended up with a quick sand of error. – Bit Hunter Apr 23 '12 at 11:46