Advice on moving towards .NET 4.0+
-
Hi, we have around 15 .NET 2.0 and .NET 3.5 applications and I've created a new .NET 4.0 app. I would like to put this with the others on our new web server however when deploying I get an error about duplicate entries in the web.config. I think it specifically relates to tags like System.Web.Extensions and clashes with the machine.config on the server. If I remove these tags then I'm sure the error will go away. My question is...what's the best approach here? Surely removing these tags every time I deploy is not the solution. Should I upgrade all the applications to .NET 4.0? If so, what then? Would I simply remove the duplicate entries from the machine.config rather than the web.config for each deployment? Can somebody please advise on the best solution moving forward for this problem? Thank you!
-
Hi, we have around 15 .NET 2.0 and .NET 3.5 applications and I've created a new .NET 4.0 app. I would like to put this with the others on our new web server however when deploying I get an error about duplicate entries in the web.config. I think it specifically relates to tags like System.Web.Extensions and clashes with the machine.config on the server. If I remove these tags then I'm sure the error will go away. My question is...what's the best approach here? Surely removing these tags every time I deploy is not the solution. Should I upgrade all the applications to .NET 4.0? If so, what then? Would I simply remove the duplicate entries from the machine.config rather than the web.config for each deployment? Can somebody please advise on the best solution moving forward for this problem? Thank you!
Make sure each application is assigned to an application pool with the appropriate .NET Framework version selected. The 4.0 application should have 4.0 selected; the 2.0 and 3.5 applications should have 2.0 selected. If your hosting all of the applications in the same site, then you'll need to make some changes to the
web.config
file: Changing ASP.NET web.config inheritance when mixing versions of child applications[^] In particular, you'll need to wrap various sections in the parent application'sweb.config
file in<location>
tags:<location path="" inheritInChildApplications="false">
...
</location>Try to avoid touching the machine-level config files - you never know whether an update will overwrite your changes.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
Make sure each application is assigned to an application pool with the appropriate .NET Framework version selected. The 4.0 application should have 4.0 selected; the 2.0 and 3.5 applications should have 2.0 selected. If your hosting all of the applications in the same site, then you'll need to make some changes to the
web.config
file: Changing ASP.NET web.config inheritance when mixing versions of child applications[^] In particular, you'll need to wrap various sections in the parent application'sweb.config
file in<location>
tags:<location path="" inheritInChildApplications="false">
...
</location>Try to avoid touching the machine-level config files - you never know whether an update will overwrite your changes.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
Hi, we have around 15 .NET 2.0 and .NET 3.5 applications and I've created a new .NET 4.0 app. I would like to put this with the others on our new web server however when deploying I get an error about duplicate entries in the web.config. I think it specifically relates to tags like System.Web.Extensions and clashes with the machine.config on the server. If I remove these tags then I'm sure the error will go away. My question is...what's the best approach here? Surely removing these tags every time I deploy is not the solution. Should I upgrade all the applications to .NET 4.0? If so, what then? Would I simply remove the duplicate entries from the machine.config rather than the web.config for each deployment? Can somebody please advise on the best solution moving forward for this problem? Thank you!
In my opinion, I would migrate the older apps to 4.0 It's really not that bad, I did 20 apps in a short amount of time. the smtp.mailclient had the biggest change, and was just a couple of lines of code. Do a test one, create a new folder, copy the project into it, and see what happens.
-
In my opinion, I would migrate the older apps to 4.0 It's really not that bad, I did 20 apps in a short amount of time. the smtp.mailclient had the biggest change, and was just a couple of lines of code. Do a test one, create a new folder, copy the project into it, and see what happens.