我最近更新了我的一个 nuget 包,因此它现在需要一个应用程序设置出现在消费项目中。我想将 app.config 转换添加到包中,以便任何使用我的包的新版本的人都将使用一些默认值填充此应用程序设置。为此,我按照这篇文章创建了 app.config.install.xdt 文件。
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<appSettings xdt:Transform="InsertIfMissing">
<add key="CustomSetting" value="CustomValue" />
</appSettings>
</configuration>
我还根据这个 stackoverflow 帖子在我的 nuspec 中添加了一行
<file src="\Content\app.config.install.xdt" target="app.config" />
但是,当我在消费者中安装/更新这个包时,我没有看到这个应用程序设置出现在消费者的 app.config 中。我还缺少其他步骤吗?