views:

2102

answers:

2

Hi,

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"

A: 

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

J.W.
I really want to keep versions.. My root should have 1.0, and my sub should have 3.5. Thx though.
Ropstah
+2  A: 

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

JarrettV
Looks nice, but doesn't work... I really want to keep versions (root: 1.0, sub: 3.5) |||||| Error: Line 12: <configSections> Line 13: <remove name="system.web.extensions"></remove>; Line 14: <sectionGroup name="system.web.extensions" ...
Ropstah
I have reported this issue as a bug to Microsoft.http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=434335
Ropstah