私は単純な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」ライブラリに問題がある可能性があります。