如何在Visual Studio编译时保存的DLL在不同的文件夹? [英] How to save DLLs in a different folder when compiling in Visual Studio?
问题描述
让我们假设我有一个的窗口形式 / 控制台应用程序的 C#项目与一些的外部引用并引用其他类库项目在同一个解决方案了。
Let's suppose I have a Window Forms / Console Application C# project with some external references and references to other class library projects in the same solution too.
当我建立的窗口形式的项目,我要引用的库存储在不同的位置(如:斌\\发布\\库),并不会在同一文件夹中的.exe
When I build the Window Form project, I want the referenced libraries be stored in a different location (eg: bin\Release\Libraries), and not in the same folder as the .exe.
是否有可能呢?
推荐答案
有2个部分的问题:
如何配置的解决方案来构建组件/ EXE到您选择的文件夹 - 这是通过VS溶液属性进行配置(解决方案属性 - >编译 - >输出路径)。还要检查值对每个参考复制本地属性。
How to configure solutions to build assemblies/EXE into folders of your choice - this is configured through properties of solution in VS (solution properties -> build -> output path). Also value of check "copy local" property on each reference.
如何从非默认位置加载组件文件(即从你的... \\库文件夹) - 你需要更改您的app.config文件添加到集搜索这个位置非默认路径(<一个HREF =http://support.microsoft.com/kb/837908> http://support.microsoft.com/kb/837908 )。
How to load assemblies files from non-default locations (i.e. from your ...\Libraries folder) - you need to make changes to your app.config file to add this non-default paths to assembly search location ( http://support.microsoft.com/kb/837908 ).
这篇关于如何在Visual Studio编译时保存的DLL在不同的文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!