Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在nuget包中包含appsettings.json配置设置?_Json_Asp.net Core_Nuget_.net Core - Fatal编程技术网

如何在nuget包中包含appsettings.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=

我正在运行.NETCore1.1、NuGet3.5,并在VSTeamServices上托管软件包

我在这里研究了变换:

但是我需要一个json文件的解决方案,而不是配置文件

我听说您可以使用install.ps1脚本包含该文件,但我也听说install.ps1已被弃用

在nuget包中包含json配置文件的当前方法是什么?

尝试使用
.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>