在VS C#中管理输出文件和文件夹(调试/发布)。 [英] Manage output Files and Folders (Debug/release) in VS C#.

查看:151
本文介绍了在VS C#中管理输出文件和文件夹(调试/发布)。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友,
当我们在项目参考中添加外部库的引用(并设置copy Localproperty =True)时,VS中的
然后在debuging之后添加一个副本调试文件夹中的.dll库,如.. \\\\Debug \ Aforge.dll。



我的问题是,我们可以做一些类似的事情,它将引用的dll文件复制到其他文件夹中。喜欢这个.. \\\\\\\\\\\\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\
like;

使用path\Aforge.net;

这样我们就可以使用带库的文件夹并在代码中使用它们。



我正在尝试管理项目的输出文件。谢谢

解决方案

这是在大多数一般(自定义)案例中解决的问题:http://msdn.microsoft.com/en-us/library/ff527268.aspx [ ^ ]。



但是,我不建议你要去做吧。另请参阅我对这个问题的评论。



我个人恰恰相反:我把AForge.NET的源代码放在了与我的应用程序项目相同的解决方案,我按项目引用程序集(Visual Studio添加引用窗口的项目选项卡),这给了我一个额外的抽象层,如果我改变一些路径,构建不会被破坏。此外,它让我有机会通过一个通用选项改变整个解决方案的平台/配置。 (此外,此时我使用自定义AForge.NET构建,只需要我真正需要的一些子集;并且我手动组装了AForge.NET项目的单独源文件。不推荐它,只是为了让它知道这是很简单。)



顺便提一下,还有一个与问题无关的建议,但是在与项目/解决方案设置相关的邻近区域:



默认情况下,当您将项目添加到解决方案时,输出将转到每个项目的单个bin / Release,bin / Debug目录。当某些程序集依赖于其他程序集时,所有必需的依赖程序集将复制到其输出目录。这样,在构建之后,最终会得到相同程序集的多个副本。这是多余的,为什么会如此?微软的目的只有一个:让所有添加和依赖的项目立即工作。这不是您在高级产品中的目标。因此,我将所有输出路径修改为顶部的某个公共目录。像这样:../../ bin。


(配置)或甚至,当一些依赖于平台的解决方案../../ bin。


(配置)。

Hi Friend,
in VS when we add a reference of external library in our "project references" (and set "copy Local" property ="True") then after debuging it adds a copy of the .dll library in debug folder like this "..\bin\Debug\Aforge.dll".

My question is that can we do something like that it copies the referenced dll file in some other folder. like this "..\bin\Debug\NewFolder\Aforge.dll" ?

or can we use external libraries without adding reference
like;
using "path\Aforge.net";
so that we can use a folder with libraries and use them in code.

I am trying to manage output files of my project. thanks

解决方案

This is how it is resolved in most general (custom) case: http://msdn.microsoft.com/en-us/library/ff527268.aspx[^].

However, I wouldn''t advice your to go for it. Please also see my comment to the question.

I personally do just the opposite: I put the source code of AForge.NET in the same solution with my application projects, and I references the assemblies by project (the "Projects" tab of the Visual Studio "Add Reference" window), which give me an additional abstraction layer, should I change some paths, the build is not destroyed. Additionally, it gives me the opportunity to vary Platform/Configuration of the whole solution by one common option. (Moreover, at this time I use the custom AForge.NET build, only some subset I really need; and I manually assembled the AForge.NET project out of separate source files. Not to recommend it, just to give an idea that this is easy enough.)

By the way, one more advice, not related to the question, but in neighboring area related to project/solution setup:

By default, when you add projects to solution, output goes to individual "bin/Release", "bin/Debug" directories per project. When some assembly depends on others, all required dependency assemblies are copied to its output directory. This way, you end up with multiple copies of the same assemblies after the build. This is very redundant, by why is it so? Microsoft does it for one purpose: to make all added and depended project "work right away". This is not your goal in an advanced product. So, I modify all output paths to some common directory on top. Like this: "../../bin.


(Configuration)" or even, when some platform-dependent solutions "../../bin.


(Configuration).


这篇关于在VS C#中管理输出文件和文件夹(调试/发布)。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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