Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nuget copy file from packages folder to project directory

Tags:

c#

.net

nuget

I have a nuget package that contains some dlls and a file "db.resources".
When I add the package to the project it references all the dlls but it does not copy the db.resources file to the project. (the file exists in the folder packages/myPackage next to all the dlls).
How do I configure nuget to copy that file to the project ?

like image 862
viktorfilim Avatar asked Feb 03 '26 16:02

viktorfilim


2 Answers

You can manually install the db.resources from the command line.. Here is a link that can help and give explanation http://blog.davidebbo.com/2011/01/installing-nuget-packages-directly-from.html

Let me know if this helps

like image 96
ivansystems Avatar answered Feb 05 '26 06:02

ivansystems


Thank you @ivansystems, your link lead me to another link (https://docs.nuget.org/create/creating-and-publishing-a-package) wich helped me figure this out.
I was configuring the 'db.resources' file wrong. In my .nuspec file it was configured to go in the folder 'lib' instead of 'content'. Now every time I install the package in a project 'db.resources' is copied in the project folder.

like image 36
viktorfilim Avatar answered Feb 05 '26 06:02

viktorfilim



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!