如何在nuget包中包含appsettings.json配置设置?
我正在运行.NETCore1.1、NuGet3.5,并在VSTeamServices上托管软件包 我在这里研究了变换: 但是我需要一个json文件的解决方案,而不是配置文件 我听说您可以使用install.ps1脚本包含该文件,但我也听说install.ps1已被弃用 在nuget包中包含json配置文件的当前方法是什么?尝试使用如何在nuget包中包含appsettings.json配置设置?,json,asp.net-core,nuget,.net-core,Json,Asp.net Core,Nuget,.net Core,我正在运行.NETCore1.1、NuGet3.5,并在VSTeamServices上托管软件包 我在这里研究了变换: 但是我需要一个json文件的解决方案,而不是配置文件 我听说您可以使用install.ps1脚本包含该文件,但我也听说install.ps1已被弃用 在nuget包中包含json配置文件的当前方法是什么?尝试使用.nuspec文件中的节点。示例来自: 如果设置生成操作:content和复制到输出目录文件属性,则它将自动复制到内容包的子文件夹。 <?xml version=
.nuspec
文件中的
节点。示例来自:
如果设置
生成操作:content
和复制到输出目录
文件属性,则它将自动复制到内容
包的子文件夹。
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<!-- ... -->
</metadata>
<files>
<!-- Add a readme -->
<file src="readme.txt" target="" />
<!-- Add files from an arbitrary folder that's not necessarily in the project -->
<file src="..\..\SomeRoot\**\*.*" target="" />
</files>
</package>