简体   繁体   English

是否有 Visual Studio Build Profiler?

[英]Is there a Visual Studio Build Profiler?

My VS.NET 2008 solution is taking longer and longer to compile (ASP.NET 3.5 + ASP.NET MVC 2 + C#) and I am wondering if there is a way to know what project takes the longer to compile and why?我的 VS.NET 2008 解决方案的编译时间越来越长(ASP.NET 3.5 + ASP.NET MVC 2 + C#),我想知道是否有办法知道哪个项目的编译时间更长,为什么? I disabled the compilation of a few projects and it helped reduce the build time but I want it faster.我禁用了一些项目的编译,这有助于减少构建时间,但我希望它更快。

Tools -> Options... -> Projects and Solutions -> Build And Run

Then change MSBuild project build output verbosity然后更改MSBuild project build output verbosity

When on normal (defaul is minimal) it gives timings for each project, so this could be used to pin point what is causing the slow down.当处于正常状态时(默认为最小值),它会为每个项目提供时间安排,因此这可用于查明导致速度下降的原因。 (Assuming you use the Output window) (假设您使用输出窗口)

Or adjust to a higher level to see more detail of what is going on during a compile.或者调整到更高级别以查看编译期间发生的事情的更多详细信息。

You can use MSBuild Profiler to get a breakdown of how long each project and it's tasks are taking.您可以使用MSBuild Profiler来详细了解每个项目及其任务所花费的时间。 It's a little old and doesn't seem to be supported but I've still found it very useful.它有点旧,似乎不受支持,但我仍然发现它非常有用。 Download and install from here then run as follows from the VS command line:此处下载并安装,然后从 VS 命令行按如下方式运行:

MSBuild.exe MySolution.sln /l:MSBuildProfileLogger,MSBuildProfiler,Version=1.0.1.0,Culture=neutral,PublicKeyToken=09544254e89d148c

When it finishes it will pop-up a GUI with a tree structure breakdown of your solution, containing the time it took to process each project and task.完成后,它将弹出一个 GUI,其中包含解决方案的树结构分解,其中包含处理每个项目和任务所花费的时间。

@PostMan's answer is what you need (hence my +1 on that) @PostMan 的回答就是你所需要的(因此我对此 +1)

The MSBuild (4.0) debugger may also prove useful MSBuild (4.0) 调试器也可能很有用

对于C ++构建,情况最近发生了变化: https : //devblogs.microsoft.com/cppblog/introducing-c-build-insights/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM