优化Visual Studio解决方案的构建 - 在哪里把DLL文件? [英] Optimizing Visual Studio solution build - where to put DLL files?

查看:129
本文介绍了优化Visual Studio解决方案的构建 - 在哪里把DLL文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现了C#的解决方案,构建时间很多项目变得更快,如果你没有复制本地启用无处不在。我做了一些测试,它似乎是(我们的解决方案至少),我们可以只通过删除复制本地增加的因素2-3生成时间。这可能意味着我们不得不存储在库中一些常见的目录。

I found out that build time of C# solution with many projects gets much faster if you don't have "copy local" enabled everywhere. I did some tests and it seems that (for our solution at least) we could increase build time by factor 2-3 just by removing "Copy local". This probably means we have to store libraries in some common directory.

任何建议/最佳实践如何达致这?请注意,我想保持引用的项目,而不是DLL文件。

Any suggestion/best practices how to acheive this? Note that I would like to keep references to projects, not to DLLs.

推荐答案

我们重新定位项目的输出目录../../Debug(或../../Release)
我们的库被放置在这些目录中也是如此。

We retarget the output directory of projects to be ../../Debug (or ../../Release) Our libs are placed in these directories as well.

我们设置的参考路径,在每个项目要调试或相应发布目录(此设置持久保存在用户文件,因为它是一个绝对而不是相对引用)

We set the reference paths in each project to be the Debug or Release directory accordingly (this setting is persisted in the user files since it is an absolute rather than relative reference)

我们保留项目引用的项目引用,所有的dll引用具有复制本地虚假和特定版本的假,除非它们是系统级的dll文件,我们知道将在GAC上的所有部署的机器。

We keep project references as project references, All dll references have copy local false and specific version false unless they are system level dlls we know will be in the GAC on all deployed machines.

这工作的款待和手动构建脚本中的IDE模拟在命令行构建(使用的MSBuild)

This works a treat and manual builds in the IDE mimic scripted builds from the command line (using MSBuild)

测试项目不适合部署不会将其输出定向到集中调试|发布目录,他们仅仅使用了标准的默认位置(并使用本地复制,以避免锁定问题)

Test projects not for deployment do not direct their output to the centralized Debug|Release directory, they just use the standard default location (and do use copy local to avoid issues with locking)

该库的版本可以通过自动化的构建过程中更换调试的DLL文件进行修改和发布目录。

The library versions may be changed by the automated build process replacing the dlls in the Debug and Release directories.

这篇关于优化Visual Studio解决方案的构建 - 在哪里把DLL文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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