I'm building a aspnet core 2.2 and all works as expected locally. When running dotnet publish on the solution, it creates a web.config but does not place this section in the web.config. Is it supposed to, or how do I get it in there?
<system.webServer>
<security>
<authentication>
<anonymousAuthentication enabled="false" />
<windowsAuthentication enabled="true" />
</authentication>
</security>
</system.webServer>
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
I found if I created an empty web.config and placed the security xml element in there, the publish picked it up and added the pieces it needed to. I would suggest placing that information into the article.
Thanks for commenting @billrob ...
IMO, the instruction is confusing, since config in IIS Manager modifies the web.config to include those settings. The topic has the reader do the IIS WinAuth config first ... before the app is published/deployed. Even if there is an app already there, deployment at that point in many scenarios will overwrite the correct web.config sitting on the server.
@scottaddie If ur busy and want to hand this off, assign me.
Thanks again @billrob for posting this. I'm going to get past the ❄️holiday ☃️ and get this scheduled asap.
Given that IIS Manager injects those settings _outside_ of the <location> element, I think the best approach is going to be to do what you did. A web.config with the settings within the <location> element makes sense for sub-app scenarios where one doesn't want inheritance. I think keeping a section on using IIS Manager makes sense, but ...
Sounds like a plan! :+1: :smile:
I'll ping u on the PR when it goes up for a look :eyes:.
Thanks @guardrex. Glad I could help.
Most helpful comment
I found if I created an empty web.config and placed the security xml element in there, the publish picked it up and added the pieces it needed to. I would suggest placing that information into the article.