我有一个 NLog.config,我必须指向另一个用于生产的数据库。我正在使用这个 工具来改造它。这是我的 NLog.Config 的一部分。
<?xml version="1.0" encoding="utf-8"?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
<target name="ExceptionLog" type="Database">
<connectionString>
---- Db Connection string for test-------
</connectionString>
我已经创建了生产转换,但是无法转换文件。
这是我所拥有的
<?xml version="1.0"?>
<!-- For more information on using app.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<parameters value="Db connection for prod"
xdt:Transform="Replace" xdt:Locator="XPath(targets/target/connectionString)" />
</configuration>
我们需要改变整个元素而不是属性。