Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to include or reference libraries in own library

I'm writing my first library in .NET core and it works fine, but if I include it in another project it throws errors that the NuGet packages are missing ("Could not load file or assembly"). Is there any way to include them in the dll of my library or at least mark them as required so I don't have to run the application that is using the library multiple times to find out which packages are missing?

Thanks in advance

like image 734
Jan Avatar asked Dec 22 '25 15:12

Jan


1 Answers

To get all the dependencies, in VS you can right click on the project and publish it. In the publish setting select the Publish Method to File System (so that you can collect your all dlls) and provide the target location and click on next. In next windows, select deployment mode as Self-Contained.

After publish process complete, you will find all the Dlls in the target location. enter image description here

like image 102
Sibgath Avatar answered Dec 24 '25 06:12

Sibgath