可以的Visual Studio编译项目引用到其他文件夹,然后主要的.exe [英] Can Visual Studio compile project references into a different folder then the main .exe

查看:163
本文介绍了可以的Visual Studio编译项目引用到其他文件夹,然后主要的.exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在VS 2008的单一解决方案中的几个项目引用一个WPF应用程序项目当我编译我的解决方案,所有被引用的DLL输出到主.exe文件输出到同一文件夹中。

I have a WPF Application project with several project references within a single solution in VS 2008. When I compile my solution, all of the referenced dlls are output into the same folder that the main .exe is output into.

是否可以配置我的主要.exe项目建设,以输出子文件相对于所有对我的.exe?

Is it possible to configure my main .exe project build to output all references in a sub folder relative to my .exe?

我想最终的结果是这样的:

I would like the final result to be something like this:

MyApp.exe的
MyApp.exe.config
LIB \\ SomeReference.dll
LIB \\ SomeReference2.dll

MyApp.exe MyApp.exe.config Lib\SomeReference.dll Lib\SomeReference2.dll

(我认为这是可能的,这将有可能与任何.exe文件)。

(I assume if this is possible, it would be possible with any .exe).

谢谢!
乔恩

推荐答案

它看起来像它的一个相当的过程。

It looks like its a fairly intensive process.

首先参考的复制本地属性设置为false,这样的.dll文件不会被复制到bin \\ Debug文件夹。

First set the reference's Copy Local property to false so that the .dlls aren't copied to the bin\Debug folder .

然后创建一个 assemblyBinding \\在你的app.config探测元指示运行时查找lib文件夹中的DLL

Then create an assemblyBinding\probing element in your app.config to instruct the runtime to look for dlls in the Lib folder

然后创建一个生成后行动所需的dll文件复制到\\ Bin \\调试\\ lib文件夹。

Then create a post-build action to copy the necessary dlls to the \bin\Debug\Lib folder.

这篇关于可以的Visual Studio编译项目引用到其他文件夹,然后主要的.exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆