开发者

500.19 Error In Web Garden Mode Only

开发者 https://www.devze.com 2023-03-06 11:23 出处:网络
My ASP.NET web app runs fine under IIS 7.5.But I want to make sure it\'s ready to run in a web farm.So I enabled web garden on my dev machine.(Set Maximum Worker Processes=2 in the app pool.)

My ASP.NET web app runs fine under IIS 7.5. But I want to make sure it's ready to run in a web farm. So I enabled web garden on my dev machine. (Set Maximum Worker Processes=2 in the app pool.)

Clicking around the site seems to go okay, but upon any AJAX request, I get 500.19 errors. The error is like:

The requested page c开发者_Python百科annot be accessed because the related configuration data for the page is invalid.

Cannot add duplicate collection entry of type 'error' with combined key attributes 'statusCode, subStatusCode' respectively set to '404, -1'

In my web config, I have this:

<system.webServer>
  <httpErrors>
    <error statusCode="404" path="Home/NotFound" />
  </httpErrors>

Looks fine to me, and I guess need it. But for fun I removed the httpErrors section. Then I get:

Unable to connect to the remote server

Of course I looked at MS's troubleshooting 500.19 errors. But I'm guessing the error is a red herring. The problem has something to do with my app pool or my code or something other than what the message is telling me. As I said, everything runs beautifully with 1 Max Worker Process.

Any ideas?

UPDATE: I have realized that the second error I mentionend, "Unable to connect to the remote server," was a real error caused by my application. So the <error> element in web.config was the cause of the 500.19 error (which masked the real error). And maybe I don't need this element because I have a similar element in system.web that seems to have the desired affect by itself.

Problem solved. However, I still wonder why there's no problem in single worker mode, and it breaks in web garden mode?


In your web.config, if you're changing custom errors you first have to remove the existing custom error, for example:

<httpErrors>
    <remove statusCode="404" subStatusCode="-1" />
    <error statusCode="404" path="http://google.com" responseMode="Redirect" />
</httpErrors>

IIS7 is quite good and the clue is often in the error message:

Cannot add duplicate collection entry of type 'error' with combined key attributes 'statusCode, subStatusCode' respectively set to '404, -1'


For me, this was fixed by installing c++ redistributable 2015 14.0.23026

0

精彩评论

暂无评论...
验证码 换一张
取 消