MSBuildおよびMSBuild コミュニティ タスク( XMLUpdate およびXMLMassUpdateを使用) を使用して、Web.config のさまざまなセクションを更新していますが、1 つ困惑しています。私が持っている場合:
<configuration>
<nlog throwExceptions="true" xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
<target name="file" xsi:type="File" fileName="${logDirectory}\SomeLog.log" layout="${message}"/>
</targets>
</nlog>
</configuration>
そして、私はのを置き換えようとしfileName
ますtarget
<XmlUpdate XmlFileName="$(BuildDir)\Builds\%(Configuration.Identity)\_PublishedWebsites\Presentation\Web.config"
XPath="//configuration/nlog/targets/target[@fileName]"
Value="${logDirectory}\SomeLog_%(Configuration.Identity).log" />
更新するものが見つからないと報告されているので、私の質問は、ファイル名属性を更新するにはどうすればよいですか?
編集: NLog セクションが独自の名前空間を定義しているため、これは名前空間の衝突のケースでしょうか?
更新:名前空間を宣言する投稿された回答は機能しません。