[英]Can Visual Studio compile project references into a different folder then the main .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. 我在VS 2008的单个解决方案中有一个WPF应用程序项目,其中包含多个项目引用。编译我的解决方案时,所有引用的dll都输出到输出主.exe的同一文件夹中。
Is it possible to configure my main .exe project build to output all references in a sub folder relative to my .exe? 是否可以将我的主要.exe项目构建配置为在相对于.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
(I assume if this is possible, it would be possible with any .exe). (我假设如果可能的话,任何.exe都可以)。
Thanks! 谢谢! Jon
乔恩
It looks like its a fairly intensive process. 它看起来像一个相当密集的过程。
First set the reference's Copy Local property to false so that the .dlls aren't copied to the bin\\Debug folder . 首先,将引用的Copy Local属性设置为false,以使.dll文件不会复制到bin \\ Debug文件夹中。
Then create an assemblyBinding\\probing element in your app.config to instruct the runtime to look for dlls in the Lib folder 然后在app.config中创建一个assemblyBinding \\ probing元素,指示运行时在Lib文件夹中查找dll。
Then create a post-build action to copy the necessary dlls to the \\bin\\Debug\\Lib folder. 然后创建一个生成后操作,将必需的dll复制到\\ bin \\ Debug \\ Lib文件夹。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.