Skip to content

<handlers> section is added to web.config when explicitly removed from source file #462

Closed
@guardrex

Description

@guardrex

The 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions