简体   繁体   English

Visual Studio可以将项目引用编译到与主.exe不同的文件夹中

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

相关问题 引用Visual Studio项目 - References the Visual Studio Project 在Visual Studio中安装项目如何从主exe设置版本 - Install project in Visual Studio how to set version from main exe Visual Studio 将 exe 放在不同的文件夹中,它不会打开 - Visual studio puts the exe in a different folder and it wont open 在Visual Studio中使用引用调试项目 - debug a project with references in Visual studio 如何将dll项目设置整合到Visual Studio 2010中用于C#应用程序的主exe.config文件中? - How can I consolidate my dll project settings into my main exe.config file in Visual Studio 2010 for a C# application? 当主项目具有任何.winmd引用时,无法生成Visual Studio Installer项目 - Cannot Build Visual Studio Installer Project when main project has any .winmd references 我可以复制项目的一些引用并将其粘贴到Visual Studio中的另一个项目引用吗? - Can I copy some References of a project and paste it to another project's references in Visual Studio? 在没有 Visual Studio IDE 的情况下将带有多个 DLL 文件的项目编译为单个 EXE - Compile project with multiple DLL file to single EXE without Visual Studio IDE 删除引用时 Visual Studio 项目无法编译,但生成的 EXE 文件在没有相同 DLL 的情况下运行 - Visual Studio project doesn't compile when deleting a reference but the built EXE file runs without that same DLL 使用Visual Studio 2012 Express for Web将Web API和文件夹引用添加到空ASP.NET项目 - Adding Web API and folder references to empty ASP.NET project with Visual Studio 2012 Express for Web
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM