我有一个简单的 xml
<?xml version="1.0"?>
<rootElement>
...
</rootElement>
我正在改变它:
<?xml version="1.0"?>
<rootElement xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform" xdt:Transform="Remove">
...
</rootElement>
然后我在构建过程中得到这个异常:
Exception while replacing configuration-variables in: D:\...\rootelement.config
17:52:12Error
System.Xml.XmlException: Root element is missing.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
17:52:12Error
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
17:52:12Error
at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r)
17:52:12Error
at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r, LoadOptions o)
17:52:12Error
at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
17:52:12Error
at Calamari.Integration.ConfigurationVariables.ConfigurationVariablesReplacer.ReadXmlDocument(String configurationFilePath) in Y:\work\14ffc968155e4956\source\Calamari\Integration\ConfigurationVariables\ConfigurationVariablesReplacer.cs:line 62
请注意,我有大约 10 个其他类似的配置文件正在转换没有问题,但这是唯一一个执行“删除”而不是“替换”的配置文件,所以我怀疑这可能是一个问题。
此外,当我在本地预览转换时,它工作正常,所以可能是 Octopus 部署和“Calamari”库的问题