h5bp / server-configs-iis

IIS Web.Config Boilerplates
MIT License
336 stars 84 forks source link

Issue when using the same web.config in two IIS applications one being a child of the other #17

Closed brgrz closed 9 years ago

brgrz commented 9 years ago

The issue is you receive a blank page when you try to run a child application of another IIS app (website) both of which use the same H5BP web.config.

The problem lies in the customheaders section of system.webServer. Unless we remove the header first in our child application we cannot add the same header name. If we do that, it results in blank page render, which is extremely difficult to troubleshoot (I wonder how no one ever experienced that before).

So the solution is to first remove the header (which for some reason some headers already do) and then add it back again.

If we don't do that we have to watch out for these blank pages and errors and have to resort to

which we don't necessarily want. I'll be creating a pull request shortly.
brgrz commented 9 years ago

What are the tab size, indent size and keep tabs/insert spaces settings for these web.configs?

ChrisMcKee commented 9 years ago

Hi, I imagine running child apps has become a tad neich over the years (don't get me wrong .net is filled with the joys of legacy); I've previously added remove X around everything being added and seeing its a boiler plate (copy, paste, delete what you dont want) I've added them in. Thanks :+1:

brgrz commented 9 years ago

Not really, child apps are popping up again with the advent of APIs, which often are standalone applications but still reside within the site.

Thanks for adding the removes.

ChrisMcKee commented 9 years ago

Have to admit, I'm slightly intrigued. Surely you either host the api within the same site and use the routing (mvc/nancyfx/servicestack can be hosted on say /api within an app) or if its a separate solution on a subdomain? The last time I dealt with a sub-application was in an old webforms site on cheap hosting where the only way to cram a new api in was to sub-app it, and that was about 5 years ago and the server was still running IIS7. :D Genuinely intrigued as to the use case