将所有输出dll放在Visual Studio的公共目录中 [英] Place all output dlls in common directory from Visual Studio

查看:98
本文介绍了将所有输出dll放在Visual Studio的公共目录中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个不同的解决方案,其中某些项目可能依赖于其他解决方案中项目的输出.为了解决这个问题,我一直在构建后将dll文件从每个项目的/bin/文件夹复制到共享库位置,然后从那里复制/引用到相关项目.

I have a couple of different solutions, in which some projects may depend on output from projects in other solutions. To manage this, I've been copying dll files from the /bin/ folder in each project to a shared library location after build, and then copy/reference them from there to the dependent project.

但是,随着库解决方案变得越来越大,这往往变得难以维护.我太多的时间都花在遍历Windows资源管理器中的解决方案目录中查找/bin/文件夹,并试图从我需要的每个dll文件中找出哪个或哪些dll文件.

However, as the library solution gets larger, this tends to become unmaintainable. Too much of my time is being spent traversing solution directories in Windows Explorer looking for /bin/ folders, and trying to figure out which one, or which ones, of the dll files from each one I need.

是否有任何方法可以使Visual Studio提示我希望解决方案中的 all 项目具有相同的输出目录?例如,直接在解决方案文件夹下的/bin/文件夹,其中 all 项目将其输出放置在其中.

Is there any way to give Visual Studio a hint that I want all projects in a solution to have the same output directory? For example, a /bin/ folder directly under the solution folder, where all projects put their output.

如果可能的话,我希望在没有复制文件的硬编码后生成事件的情况下实现此目的,因为如果项目输出更改文件名或添加另一个文件,该事件将失败.如果您愿意,我想更改实际输出目录的位置-$(OutDir)的位置.

If possible, I'd like to achieve this without hard-coded post-build events that copy the files, since that will fail if a project output changes file name, or adds another file. I'd rather like to change the location of the actual output directory - the location of $(OutDir), if you will.

推荐答案

您可以在每个项目属性中设置输出目录.

You can set the output directory in each project properties.

右键单击项目,选择Properties

对于C#,它是Build属性页之一,位于OutputOutput directory下.

For C#, it is one of the Build property page, under Output, Output directory.

在VB.Net项目中,它位于Compile选项卡的顶部文本框中.

In VB.Net projects, it is on the Compile tab, in the textbox at the top.

这篇关于将所有输出dll放在Visual Studio的公共目录中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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