Open mahamr opened 3 years ago
@mahamr Thanks for this. I had the same issue recently and I'd wish that this would already have been documented. That would have saved me some time.
@Rick-Anderson Could this issue please be triaged again?
There is also another problem with the web.config
file:
If you have one like documented in your project root, you can't start the application with IIS Express any more. It's the same problem (locked configuration section) as with the full IIS, but I don't see a way to change the IIS Express settings.
Also, this issue happens even though I've configured the IIS Express launch settings as documented in the "IIS/IIS Express - Launch settings (debugger)" section.
Under the IIS section of this doc, there are two approaches for enabling Windows Authentication.
The first approach is this:
The problem with this is it does not consider IIS Feature Delegation, which by default does not allow a web.config file to modify the anonymousAuthentication and windowsAuthentication sections (they are locked as read-only). Doing this as-is, without unlocking those sections, results in a 500.19 error from IIS due to modifying locked sections.
Both sections must be unlocked before they can be modified. Here is how to do this for both sections:
It can also be performed in the IIS Manager interface: IIS Manager -> root/server node -> Feature Delegation Authentication - Anonymous => change to Read/Write (default=Read Only) Authentication - Windows => change to Read/Write (default=Read Only)
CSS just had a support case for this, and the customer confirmed this is the doc they used.
The 2nd approach on the doc site says this (note my emphasis):
"When these actions are taken, IIS Manager modifies the app's web.config file." This is incorrect if IIS Feature Delegation has not been configured as noted above, and the Windows Auth and Anonymous Auth configurations are still locked as read-only. When modifying a configuration in IIS Manager at a level where that configuration is locked, IIS will make the configuration at a higher level and wrap it inside a
<location>
tag indicating where at the lower level the configuration should be applied. Thus, when making changes to Windows Auth and Anon Auth, the change will be placed into the applicationhost.config. For the wording as-is to be accurate, both features must be unlocked as described earlier.I suggest there be wording above the approaches showing how to unlock the IIS configuration, then the approaches will work as described:
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.