Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
192 views
in Technique[技术] by (71.8m points)

asp.net - Steps to Investigate Cause of Web.Config Duplicate Section

Symptoms

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

"There was an error while performing this operation....   Filename... 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:WindowsMicrosoft.NETFrameworkv2.0.50727CONFIGmachine.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?
question from:https://stackoverflow.com/questions/2475329/steps-to-investigate-cause-of-web-config-duplicate-section

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...