Question

I have been working on creating a Nuget package to include my Logger project and NLog into the package. The dll's and dependencies are correctly setup and it installs fine on my machine but the NLog.config file does not get copied over to the lib folder. I have the nuspec file below. If I manually move the NLog.config file to the \bin\Debug folder it works fine then.

How can i get it to be copied over to that location with the nuspec file. I have also tried to set the target to the "content" folder which copies it to the root folder but that doesnt work either. Please let me know as i have been trying for hours to get this right. I appreciate the help, thanks

<?xml version="1.0"?>
<package >
 <metadata>
   <id>Packager</id>
    <version>1.0.0</version>
    <title>EYPackager</title>
    <authors>rmifss</authors>
    <owners></owners>
    <description>
    </description>
    <releaseNotes>
    </releaseNotes>
    <summary>
    </summary>
   <language>en-US</language>
   <projectUrl>https://nuget.org/packages/Packager</projectUrl>
   <iconUrl>https://nuget.org/Content/Images/packageDefaultIcon-   
   50x50.png</iconUrl>
   <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <licenseUrl>http://opensource.org/licenses/Apache-2.0</licenseUrl>
    <copyright>Copyright  2014</copyright>
   <dependencies>
     <dependency id="NLog" version="2.1.0" />
   </dependencies>
   <references></references>
   <tags></tags>
  </metadata>
  <files>
    <file src="..\PanaceaLogging\bin\Debug\Panacea.dll" target="lib" />
    <file src="..\PanaceaLogging\bin\Debug\NLog.config" target="lib" />
    <file src="lib\" target="lib" />
    <file src="tools\" target="tools" />
    <file src="content\" target="content" />
  </files>
 </package>
Was it helpful?

Solution 2

Ok I think it must have been a late night last night, in order to get it to the bin\debug folder, all i had to do was change the target to "content\bin\debug". Once I changed that the Nuget package installed it into that location. Hope that helps someone else too.

OTHER TIPS

In the solution explorer, find your config file. then right click->properties In the property explorer find the "copy in output directory" cell and then select "Always copy". It will do the job.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top