0

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

4

1 に答える 1

2

XML ドキュメントにはルート要素が必要なため、変換によって無効な XML ドキュメントが生成されます。

このエラーは、変換後に Octopus がファイル内の変数を置き換えようとしたときに発生します。XML ドキュメントが無効なため、読み込めません。

有効な XML ドキュメントになるように、変換を変更する必要があります。

于 2016-05-18T17:41:43.940 に答える