我正在使用 Visual Studio 中的一个相当大的解决方案,其中包含 130 多个项目(不要问)。
它有大约 40 种不同的解决方案配置,因此一次只构建解决方案的子集。即使只构建大约 25 个项目,在具有 SSD 的机器上进行增量构建仍然需要大约 30 秒到 1 分钟。
这是一个旧的解决方案,所以它随着时间的推移而增长,现在可能有些东西已经降级了,但是在启用详细的构建日志之后,我看到每个构建都记录了以下内容:
Dependency "AWSSDK, Version=1.0.9.0, Culture=neutral, PublicKeyToken=cd2d24cd2bace800".
Resolved file path is "C:\Program Files (x86)\AWS SDK for .NET\bin\AWSSDK.dll".
Reference found at search path location "{AssemblyFolders}".
For SearchPath "aaaaaaaaaaaa\bin\Debug".
Considered "bbbbbbbbbbb\bin\Debug\AWSSDK.dll", but it didn't exist.
Considered "bbbbbbbbbbb\bin\Debug\AWSSDK.exe", but it didn't exist.
For SearchPath "{TargetFrameworkDirectory}".
Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\AWSSDK.dll", but it didn't exist.
Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\AWSSDK.exe", but it didn't exist.
For SearchPath "{Registry:Software\Microsoft\.NETFramework,v4.0,AssemblyFoldersEx}".
Considered "C:\Program Files (x86)\NUnit 2.5.2\bin\net-2.0\framework\AWSSDK.dll", but it didn't exist.
Considered "C:\Program Files (x86)\NUnit 2.5.2\bin\net-2.0\framework\AWSSDK.exe", but it didn't exist.
Considered "C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\AWSSDK.dll", but it didn't exist.
Considered "C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\AWSSDK.exe", but it didn't exist.
Considered "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ReferenceAssemblies\v4.0\AWSSDK.dll", but it didn't exist.
...
Required by "bbbbbbbb\bin\Debug\xxxxxxxxx.dll".
Found related file "C:\Program Files (x86)\AWS SDK for .NET\bin\AWSSDK.xml".
This reference is not "CopyLocal" because it's registered in the GAC.
这至少持续了一百多条路径。
AWSSDK 被我们的核心库引用,它充当它的外观,引用我们外观的每个其他项目然后重复这些消息。门面的库引用了 Copy Local: True,但它似乎在 GAC 中,并且没有与我们的 dll 一起提供到 bin 文件夹。
还有许多其他依赖项输出相同的消息,而不仅仅是这个。
它最终会找到它,但我无法想象这对硬盘驱动器的寻道时间有好处,而且它可能会对构建时间产生负面影响。
谷歌搜索并没有发现任何相关信息。
编辑:好的,我将缓慢的构建问题主要缩小到 Visual Studio 中的 Visual WebGui 集成。我在这里发布了我的发现:http: //visualwebgui.com/Developers/Forums/tabid/364/forumid/56/postid/50540/scope/posts/Default.aspx
尽管如此,知道如何帮助 MSBuild 不考虑那么多路径并更快地找到东西会很有趣。不过,SSD 有很大帮助。