2
votes

i'm having problems running my MVC project on my server. The main project on the server has it's own web.config file (1.0 versions referenced in configsections), while the 'virtual subproject' also has one (3.5 versions referenced). I receive the following error:

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: Section or group name 'system.web.extensions' is already defined. Updates to this may only occur at the configuration level where it is defined.

Main web.config (location: http://servername/web.config) section:

sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

Subproject web.config (location: http://servername/subproject/web.config) section:

sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"

2

2 Answers

3
votes

Try removing the section before the second definition all within the Subproject web.config.

See: http://forums.iis.net/t/1155685.aspx

You can remove predefined section or section group by using element in the sub sites' web config file. It looks like this:

<configuration>
 <configSections>
  <remove name="system.web.extensions "/>
  <!-- Add your new section or section group -->
  </configSections>
</configuration>

For more information,

please refer to: <remove> Element for <configSections> http://msdn.microsoft.com/en-us/library/aa309404(VS.71).aspx

0
votes

Did you reference two different version of dll, otherwise, change them both to 3.5.0.0.