views:

858

answers:

5

Symptoms

  • In IIS 7 and Dot Net 2.0 Integrated app pool: double clicking to view any web.config section results in a the following error dialog.

"There was an error while performing this operation....   Fielname... web.config...    Error: There is a duplicate..."

  • Browsing to the URL displays: "Http 500.19" internal server error.. There is a duplicate... 'system.web.extensions/scripting/scriptResourceHandler' section defined...."

  • Running the app from VS 2008 an "Unable to start debugging on the web server..." dialog is displayed.

Infrastructure

  • Web server: IIS 7 running on Windows 7 x64
  • ASP.Net MVC2
  • Application pool: Dot Net 2.0 integrated
  • VS 2008

Things Tried

  • Checked to see if the problem was occurring in other IIS app directories on the same machine.
  • Removed and re-added the application in IIS.
  • Reverted to prior versions of the web.config file.
  • Checked out a last working version of the source code. Rebuilt the app, added a new app directory for it and tried to view web.config contents from IIS.
  • Looked for web.config files that might have duplicate sections in:
    • Inetpub root.
    • "C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config"
    • The "Views" subfolder of the ASP.Net MVC app.
  • Checked out source code to another dev machine. Setup IIS 7 app folder. No problem with Web.config.

Question

  • If the reason for this error is another web.config file where else should I look?
  • Are there other reasons for these symptoms?
A: 

I'have the same problem! Any solution, please?

Mojster
Just a word of guidance on Stack Overflow etiquette. It's not a good idea to post 'me too!' requests as answers as you're highly likely to be downvoted.
Kev
-1: As Kev says. Really, this isn't even appropriate as a comment. This isn't a discussion board. If the OP accepted an answer and nothing in the thread solved your problem, asking the same question, with a link to this one, would not be inappropriate.
Brian
+4  A: 

Add this to the checklist.

  • Make sure that the machine.config you check is from the same Dot Net framework as the application pool your application is running under.

In my case the default application pools was changed from Dot Net 2.0 to Dot Net 4.0. This changed the root machine.config to the 4.0 version. This version contains the "scriptResourceHandler" section as well as others. Thus the duplicate section warning.

pauly
A: 

It might be worth opening up the applicationHost.config file:

C:\Windows\System32\inetsrv\config\applicationHost.config

Specifically, look for <location> tags that match the site name (there can be multiple entries) and see if there's duplicate scriptResourceHandler sections declared there. I'd also check the contents of <location path=""> as well.

Kev
A: 

I have the same problem, I am still trying to fix it, it seems to be related with Framework 4.0, I installed the VS2010 beta, after I installed that, MVC projects were not working anymore on vs2008, I had to uninstall VS2010 and then reinstall MVC v1 for vs2008, does ant body has solved the problem?

Pedro
A: 

In IIS 7 change the Application Pools setting for the appPool named "Classic .NET AppPool" to V2.0. Do this by right clicking the Classic .NET AppPool and selecting "Basic Settings..." then reset the .NET Framework Version to V2.0.xxxxx. Recycle the app pool and restart the web site and it should work fine.

Mike