I am running .net core 1.1 and nuget 3.5.
Here is my nuspec:
<?xml version="1.0"?>
<package >
<metadata>
<id>ClassLibrary1</id>
<version>1.0.0.4</version>
<title>Class Library Test Content</title>
<authors>name</authors>
<owners>name</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>package to test config file transfer</description>
<copyright>Copyright 2017</copyright>
<tags>TagUno TagDos</tags>
<contentFiles>
<files include="appsettings.json" buildAction="Content" copyToOutput="true" />
</contentFiles>
</metadata>
<files>
<file src="binDebug
et462classlibrary1.dll" target="lib
et462classlibrary1.dll" />
<file src="appsettings.json" target="content
et462appsettings.json" />
</files>
</package>
It produces this package:
As we can see, the appsettings.json file is located in the content folder in the nuget package.
However, when I install the package to my project, the appsettings.json file is not copied to the project root.
What am I missing? Or is this done differently in .net core?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…