The first DotNetNuke version to be supported under asp.net 4.0 was the 5.4.0 release (earlier versions will work, but require manually updating web.config entries and may break some core modules). Below are listed some items to be aware of if planning on using asp.net 4.0.
- DotNetNuke 5.4.0 will install if you are running with an Application Pool that is configured for use with .NET 4. One of the core modules was removed from the distribution as it had issues with .NET 4 (Gallery). The module team have fixed the issue and it is available in beta form from codeplex and was added to the 5.4.1 distribution
- DotNetNuke 5.4.0 and above will continue to install and run in .NET 3.5 SP1 as before
- If you are running DotNetNuke on ASP.NET 3.5 SP1 and you switch to an Application Pool that is configured for .NET 4.0 DotNetNuke will detect the change in Framework version and make some minor changes to web.config.
- If you are running DotNetNuke on ASP.NET 4 and switch to an Application Pool running .NET 3.5 you will get a YSOD (Yellow screen of death) with an error message. If you undo (manually) the changes made to web.config the error will go away.
Notes
There are a few things to note about ASP.NET 4 and the changes we did to allow us to support both versions of .NET.
- Browser Files - ASP.NET 4 ships with a different core set of browser files - since 5.3 we have included an extra browser file (Netpatch.browser) which includes the neccessary pieces from the .NET 2.0 browser files (that are missing in .NET 4)
- Control Rendering - Image controls in .NET 2.0 are automatically rendered with a style attribute - style="border:0". In .NET 4.0 this attribute is not rendered by default. Images inside hyperlinks are automatically rendered with a border by the browser, unless over-ridden by css, so to solve this we have added a default style in default.css for images that includes the border:0 style for all <img> tags. This allows images to be displayed correctly in both versions.
- System.Web.Extensions - we have removed the System.Web.Extensions configuartion section (as this is now defined at the machine level)
- Version Detection - we now detect version 4.0 and display it correctly in Host Settings
- Malformed HTML - .NET 4.0 is much less forgiving than .NET 3.5 if html (in ascx controls) is malformed - eg style="width:0"" - note the double quotes. We have cleaned up core ascx files but 3rd party modules may have issues.
- Request Validation - .NET 4.0 is stricter with validation of form data sent back to the server, so we have modifed web.config to set request validation to work in 2.0 mode.
Note: if your site permissions are wrong and the web.config does not update, you will see the following error "A potentially dangerous Request.QueryString value was detected from the client". Please fix the incorrect permissions, but to resolve this issue please update your web.config to show <httpRuntime requestValidationMode="2.0" />
Other links
List of asp.net 4.0
breaking changes