1

慢骗子的所有示例似乎都集中在配置文件的应用程序设置部分。

我很想知道是否可以通过自定义配置设置实现类似的输出。

例如

<MyConfigSection username="debug" password="d3bUg" />

将转变为

<MyConfigSection username="release" password="re1eas3" />

编辑 我发现这xdt:Transform="Replace"将在这个例子中起作用。但是,如果我有其他没有改变的属性,我将如何在不从配置中丢失它们的情况下实现这一点?

例如

<MyConfigSection username="debug" password="d3bUg" apiKey="12345" />
<MyConfigSection username="release" password="re1eas3" apiKey="12345" />

如果我用

<MyConfigSection username="release" password="re1eas3" xdt:Transform="Replace" />

然后 apiKey 会消失

4

1 回答 1

1

这只会替换您的属性,保留 MyConfigSection 中的其他部分

<MyConfigSection username="release" password="re1eas3" xdt:Transform="SetAttributes(username, password)" />
于 2013-11-28T11:50:32.433 回答