I am currently writing applications with a plugin system. Plugins are separate projects that are not referenced to the main project only to the pluginAPI project. Plugins dll's are copied to a separate folder without dependencies. If PluginAPI reference to nuget package it's ok since can handle this but the problem appears when the plugin refers to a nuget package that is not installed in the PluginAPI project. I would like Visual Studio to automatically copy the dll files that I point to the build folder.
Asked
Active
Viewed 2,814 times
3 Answers
0
- You can add a post-build event, where you can use the xcopy to copy files to the desired directory. Please see https://stackoverflow.com/a/11001949/6382313 for details
- You can add the NuGet to the API project as well, it will also copy the NuGet output to the API build directory

mhsarosh
- 308
- 1
- 7
-
The second solution destroys the whole meaning of the plugin system. First solution sounds good but I need example. – KAW Jun 27 '21 at 19:16
0
From what I know, NuGet packages ( For Example EPPlus ) automatically add their dlls as a reference, you can right-click on that reference and change the Property
Copy Local
to true
.
This will copy that dll file to the output
folder.

Mostafa Tarek Yassien
- 370
- 2
- 5
- 18