直到今天早上我更新到2.1.401,一切都很好。我有一个CI / CD进程(使用Jenkins),它使用CLI命令在生成的web.config文件(.NET Core生成)上运行转换。该文件正是生成的,没有更改:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\MyService.WebApi.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</location>
</configuration>
由于我们的服务器配置,我需要将一个验证元素添加到system.webServer节点。
这是转换文件:
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<system.webServer>
<validation validateIntegratedModeConfiguration="false" xdt:Transform="Insert" />
</system.webServer>
</configuration>
这似乎是相当紧张的前进。但是现在,自从将.NET Core更新到2.1.401后,我遇到了一个错误:
[dotnet-xdt]错误'':4:5:DotNet.Xdt.XmlNodeException:源文档中的任何元素都不匹配'/configuration/system.webServer/validation'
作为参考,我使用.NET Core CLI中的XDT工具和命令:
dotnet xdt --source .\web.config.full --transform .\web.dev.config --output .\web.config
我不明白为什么会出现这个错误,我不是试图匹配那个元素,我正在尝试插入元素,所以当然它不存在......它不支持存在!
我似乎无法找到任何改变2.1.301 - > 2.1.401的变化,我正在试图修复所有现在因此而破坏的所有约20个工作。
任何洞察力,想法,指出可能的错误,任何事情在这一点上真的会有所帮助!
web.config.full中没有部分/configuration/system.webServer
节点。但是存在/configuration/location/system.webServer
节点。