Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

nuget not installing file in project\bin directory

$
0
0

Working in VS 2019 .NET framework 4.8For my C# class library project, I ran nuget spec to create a nuspec file for the dll and its dependencies:

<?xml version="1.0" encoding="utf-8"?><package ><metadata><id>MyId</id><version>1.0.0</version><title>MyTitle</title><authors>Me</authors>    ....<dependencies><dependency id="dll1" version="1.0.0" /><dependency id="dll2" version="2.0.0" /></dependencies></metadata></package>

No problems building the nuget package. In my consuming project (MyProject), I installed that package, and after building MyProject, the class library dll and the dependency files are placed in the MyProject\bin directory. Great.

However I need to get another file into directory MyProject\bin, let's call that file MyFile.txt. I first tried using the element:

  ..... <dependency id="dll2" version="2.0.0" /></dependencies></metadata><files><file src="MyFile.txt" target="lib" /></files></package>

No luck. While the file is in the packages\lib folder, it does not get placed in MyProject\bin.

I then removed the element and tried the element within the tag:

  .....  <contentFiles><files include="MyFile.txt" buildAction="None" copyToOutput="true" flatten="true" /></contentFiles></metadata></package>

No luck that way either. Is there a way to accomplish what I need to do? It looks like it may involve having some folders in my class library root folder, but not sure what folders (content?) or how to properly reference them in the nuspec file. Thanks.


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>