My nuget package is for a library that needs a configuration file (ClassLibrary1.dll.config). I've tried to bundle it like this:
This is the nuspec file:
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>ClassLibrary1</id>
<version>1.0.0</version>
<authors>ClassLibrary1</authors>
<owners></owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Package Description</description>
<dependencies>
<group targetFramework="net5.0" />
</dependencies>
</metadata>
<files>
<file src="lib\net5.0\ClassLibrary1.dll" target="lib\net5.0\ClassLibrary1.dll" />
<file src="lib\net5.0\ClassLibrary1.dll.config" target="lib\net5.0\ClassLibrary1.dll.config" />
</files>
</package>
I have an application that references this Nuget package. The assembly is correctly copied to the output folder, but the .dll.config is not.
This is the output folder:
What's wrong? What should I do to get the config copied to the output directory?
I'm using Nuget 5.10+
BTW, I've read the answers to this post and none of them worked: