<handlers> section is added to web.config when explicitly removed from source file
See original GitHub issueThe Sdk (or perhaps to me more precise Sdk.Web
) is explicitly adding the <handlers>
section to web.config
even when I have explicitly removed it.
If the project includes a source web.config
such as this …
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<aspNetCore stdoutLogEnabled="false" stdoutLogFile=".\logs\aspnetcore-stdout">
</aspNetCore>
</system.webServer>
</configuration>
on dotnet publish
, the web.config
file that appears in published output is …
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule"
resourceType="Unspecified" />
</handlers>
<aspNetCore stdoutLogEnabled="true" stdoutLogFile=".\logs\aspnetcore-stdout"
processPath="dotnet" arguments=".\testportable.dll">
</aspNetCore>
</system.webServer>
</configuration>
The reason this is a problem is that my app in this case is a subapp, which cannot have a <handlers>
section. Every publish, I must manually delete the <handlers>
section in the published output web.config
.
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
ASP.NET IIS Web.config [Internal Server Error]
I had a problem with runAllManagedModulesForAllRequests, code 0x80070021 and http error 500.19 and managed to solve it.
Read more >HTTP Error 500.19 - Internal Server Error - Microsoft Q&A
Config Error This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking...
Read more >IIS 8 asp.net mvc HTTP Error 500.19
The system.webServer/Handlers section has been locked somewhere else, meaning that you can not override it in the web.config file at the current ...
Read more >Setting the web.config File - Documentation - Telerik
Configure the mandatory additions, set the control properties, and add optional configurations to the web.config file when working with Telerik UI for ASP....
Read more >ASP.NET Core IIS InProcess Hosting Issue in .NET Core 3.1
I ran into a nasty issue yesterday related to hosting an ASP.NET Core 3.1 server application in IIS using the default InProcess hosting....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks @nil4 👍
Adding …
… to the
<PropertyGroup>
stopped the transform, thus it prevented myweb.config
from being modified and having the<handlers>
section added to it.The only thing devs need to keep in mind is that their
web.config
will only be moved. Devs will need to set theprocessPath
andarguments
manually in their source file prior to publishing/deploying an app.Use of this property is probably “the answer” to this issue, so I’ll close.
It’s just a quick-and-dirty port of the CodePlex XDT code to .NET core, with known weaknesses around whitespace preservation and missing unit tests (as you can probably tell from the bug you just found 😀). It works well enough for my own needs, and apparently it’s useful for other people too. If there’s a chance to link it from the docs, that would be great. 👍
If (or rather when) you guys get to https://github.com/aspnet/Tooling/issues/780, I would be happy to hand over the ownership of the NuGet package if that’s something you are interested in. I published the first version under a Microsoft.* name without thinking. /cc @sayedihashimi