dotnet publish
seems not to take the existing web.debug.config
.
Steps
dotnet publish
from CLI and grabbed the default web.config
from publish folder.web.debug.config
with same content as the default to the project root.web.debug.config
, added timeout value <aspNetCore requestTimeout="00:02:00" ...
.dotnet publish
again, the web.debug.config
gets copied to the publish folder, default web.config
is still there.web.config
with the content from my own web.debug.config
.I have played around with <CopyToOutputDirectory>Never</CopyToOutputDirectory>
and <CopyToPublishDirectory>Never</CopyToPublishDirectory>
resulting the file beeing copied or not, but without effect on the actual content of web.config
.
What am I missing or is my expectation among Transforming Web.config wrong?
https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/transform-webconfig?view=aspnetcore-7.0
My assumption was wrong:
a web.debug.config
does not replace the web.config
but transform it using the xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"
namespace and later its Locator
and Transform
attributes.