[英]Referenced project's necessary files not copied to the release folder
I have a solution made out of 2 projects. 我有2个项目组成的解决方案。 One is A
which is my main project and one is B
. 一个是A
是我的主要项目,另一个是B
A
has a reference of B
in it. A
有一个B
的引用。 So when I build the entire solution, B
's .exe
file is created in the release folder. 因此,当我构建整个解决方案时,将在release文件夹中创建B
的.exe
文件。 But B
also has reference to some .dll
libraries that are also needed for the program to be working. 但是B
也引用了一些.dll
库,这些文件对于程序正常运行也是必需的。 And they do not appear in the release folder. 并且它们不会出现在发布文件夹中。
How can I change my build properties so that all the necessary files will be copied so I don't have to copy them manually every time? 如何更改构建属性,以便所有必需的文件都将被复制,因此我不必每次都手动复制它们?
The quick and dirty way is to manually add B
's dependencies into A
's project. 快速而肮脏的方法是将B
的依赖项手动添加到A
的项目中。
A less error prone way would be to have a single common bin
folder that both projects output to. 一种不太容易出错的方法是将两个项目都输出到一个公用bin
文件夹。 You set B
to build into it and then A
references the B
dll from there so all the transitive dependencies are put in place just by building B
. 您将B
设置为内置,然后A
从那里引用B
dll,以便仅通过构建B
便将所有传递依赖项放置到位。
Yet another approach would be to get B
to build a Nuget package (which then describes its dependencies) and then use Nuget to add B
as a package to A
and it'll sort the rest out for you. 还有另一种方法是让B
构建一个Nuget包(然后描述它的依赖项),然后使用Nuget将B
作为包添加到A
,其余的将为您解决。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.