Running a virtual directory inside a DotNetNuke website can result in the error Could not load file or assembly System.Web.Extensions. This is caused by the virtual directory inheriting the web.config file.
An example of the error is given below:
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: Could not load file or assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. (C:\Inetpub\wwwroot\web.config line 56) Source Error:
Line 54: <httpModules> Line 55: <!-- add name="Authentication" type="DotNetNuke.HttpModules.AuthenticationModule, DotNetNuke.HttpModules.Authentication" / --> Line 56: <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> Line 57: <add name="Compression" type="DotNetNuke.HttpModules.Compression.CompressionModule, DotNetNuke.HttpModules" /> Line 58: <add name="RequestFilter" type="DotNetNuke.HttpModules.RequestFilter.RequestFilterModule, DotNetNuke.HttpModules" />
Source File: \web.config Line: 56
To resolve the error the DotNetNuke website’s web.config should be inherited by the virtual directory. To inherit the configuration file the <system.web> tag is wrapped with a location tag:
<location path=”.” inheritInChildApplications=”false”>
The section of the web.config file, with the wrapper is shown below:
<location path="." inheritInChildApplications="false"> <system.web> <machineKey .... </system.web> </location>


