简体   繁体   English

引用项目的必要文件未复制到发布文件夹

[英]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.

相关问题 子项目引用的某些DLL未复制到Solution的输出文件夹 - Some DLLs referenced by sub-project not being copied to Solution's output folder 类库项目中引用的Dll不会被复制 - Dll's referenced in class library project are not being copied 如何防止在辅助类中引用的未使用的 dll 被复制到项目中? - How to prevent unused dll's referenced in helper class to be copied to project? 同一解决方案中其他项目引用的Copylocal dll没有复制到输出文件夹中 - Referenced Copylocal dll from other project in same solution not copied into output folder 为什么即使编译时没有引用任何库,也会将dll文件复制到项目的Bin / Debug文件夹中? - why are there dll files copied to my project's Bin/Debug folder upon compilation despite not referencing any of those libraries? 构建项目的发布版本无法在发布文件夹中生成文件 - Building release version of a project fails to generate files in the release folder 如何防止引用的程序集的嵌入式依赖项被复制到Visual Studio中的输出文件夹? - How to prevent a referenced assembly's embedded dependency from being copied to output folder in Visual Studio? 引用的项目依赖项DLL不被复制 - Referenced project dependencies DLL are not being copied 引用的DLL驻留在项目的\\ bin \\ Debug文件夹中是否可以接受? - Is it Acceptable for Referenced DLLs to reside in the project's \bin\Debug folder? 引用的项目的pdb文件不在此项目应用程序文件列表中 - A referenced project's pdb file not in this projects application files list
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM