Running DotNetNuke with .NET 4.0 

As more and more people start working with DotNetNuke, IIS7, and .NET 4.0 it is important to note a few important potential problem areas when it comes to running DotNetNuke on the 4.0 framework.  Recently I took a DNN 5.4.4 installation and tried running it under .NET 4.0 and without modifications, it was a complete failure, in this blog posting I will show you what needs to change to allow DotNetNuke to work as expected.

In my test I noticed that after switching my application pool to run on .NET 4.0 a number of DNN functions stopped working such as the logoff page, the captcha control, and more critically LinkClick.aspx which is used for file linking.  This issue only impacted my installations running on Windows 7 and Windows Server 2008, my Windows XP and Windows 2003 machines were working just fine, which led me right to the issue, the web.config file.

In the web.config file there are a collection of nodes, <system.webServer><handers> with a number of <add ... nodes underneath.  This section of the web.config is used by IIS7 to auto configure DNN and is where the problem comes in.

Many of the handlers here have the following attribute defined "preCondition="integratedMode,runtimeVersionv2.0""  The key issue here is the runtime version, which is going to cause major issues, as when running in 4.0 this handler is bypassed, breaking functionality.

To resolve the issue simply remove the "runtimeVersionv2.0" portion from the pre-condition and you should be up and running.  I recommend removing this pre-condition from ALL handlers in this section.

Feel free to share your comments below with any other issues you may have experienced with .NET 4.0 and DNN.

Posted by Mitchel on Tuesday, July 27, 2010
 

Comments

I just spent today trying to figure this issue out.
I also came across an interesting post from Microsoft on the breaking changes with asp.net 4.0 with relevance to markup, web.config and other items. It's worth reading if your considering moving up to 4.0.

http://www.asp.net/learn/whitepapers/aspnet4/breaking-changes

By usheen on Tuesday, July 27, 2010 at 4:23 PM

Yup, I had the exact same experience.

By David O'Leary on Tuesday, July 27, 2010 at 5:39 PM

Hi,
Just moved my DNN 5.01.02 sites to Windows 2008 R2 Server with IIS 7.5 a week ago - and have similar problems. The suggested changes in web.config seems not to solve my problem. The strange thing is that the sites are "unstable" - one moment the logout (and all other links that dos doPostBack's) dos not work and at other times it works as expected. Any ideas how to track this problem down? Thanks.

By Kim on Wednesday, July 28, 2010 at 4:54 AM

I'm a rookie , I'm still using VS2005 now

By Zenoven on Tuesday, August 10, 2010 at 2:58 AM

So what you're saying is that if I build a site with DNN I can look forward to it having problems when my hosting co upgrades!

By bman on Monday, August 23, 2010 at 9:46 AM

Thank you,
But it was better if you explain more about the methods you used for upgrading :
upgrading the project and/or only IIS pool!

Also the web.config changes needed to be done. is it only the portion?
thanks

By Ghalib on Monday, December 27, 2010 at 8:02 AM

I upgraded a couple nopCommerce sites to ASP.net 4.0 on my dedicated server and found this knocked out some of my DNN sites.

The issue? There needed to be a separate application pool for sites using ASP.net 4.0. Obvious in retrospect but not at the time.

I created a separate Application Pool for these 4.0 applications and all are now co-existing happily.

By Peter Smith on Sunday, February 20, 2011 at 8:34 PM

I have the same problem, but the login control does not show up even after deleting the code in the web.config

By PD on Wednesday, August 31, 2011 at 4:36 AM

Name (required)

Email (required)

Website

CAPTCHA image
Enter the code shown above:

Content provided in this blog is provided "AS-IS" and the information should be used at your own discretion.  The thoughts and opinions expressed are the personal thoughts of Mitchel Sellers and do not reflect the opinions of his employer.

Friend of RedGate

www.datasprings.com - DotNetNuke ModulesICG

Click here for advertising information.

Content in this blog is copyright protected.  Re-publishing on other websites is allowed as long as proper credit and backlink to the article is provided.  Any other re-publishing or distribution of this content is prohibited without written permission from Mitchel Sellers.