msbuild timeout - msbuild

Well I have a fairly large project which msbuild keeps timing out on.
How can we stop msbuild from timing out?

If you want to get a timeout, you could use cruiscontrol.net or Nant or some other build platform, and you can specify a timeout there.

You might want to look at this hotfix from MS.
Per the Hotfix information: If a build takes longer than 59 minutes then it will timeout.

Related

How to enable wall-clock profiling for Intellij Async Profiler?

I'd like to measure how much time my app spends in the database.
I've added the CPU Profiler to Intellij's Settings / Build / Java Profiler, but by default it shows the code with most CPU cycles, which is useless for me since the JDBC driver basically sleeps while the response is received.
Sounds like Wall-clock profiling is the way to go, however I don't know how to enable that in Intellij's CPU Profiler configuration window. The README says -e wall, while Intellij's Agent Options look totally different: threads,interval=1ms,framebuf=15000000. How can I configure Intellij's Async Profiler to use Wall-clock please?
The answer, according to the comment above by y.bedrov is to use the "event=wall" option. For me, using Ultimate 2020.1 with the defaults already set up...
IntelliJ IDEA / Preferences... / Build, Execution, Deployment / Java Profiler / CPU Profiler / Agent options: threads,interval=1ms,framebuf=15000000,event=wall
I'm putting it in the form of an answer not because I want to get the credit, but because when I looked at this question originally, I almost ignored it because there was no answer. Then I noticed that the answer was in a comment.

TFS 2013 BuildAgent hanging while building solution

We have a problem with the TFS build agent intermittently hanging while building our solution. We have some custom build actions, we're using eazfuscator, and we have some post build actions as well.
So it's quite possible we are causing the problem. We've identified that the solution (filled with C# projects) starts compiling but does not finish. What we need is the log file from MSBuild/csc, but because the solution never finishes, those logs never go to the build drop.
I need help finding the log file on the build agent. Any ideas?
Thanks!!
I suggest you to copy the MSBuild command which is generated in TFS build for code compilation, run the same command on build agent server manually from command prompt. Here, you will get more details to figure out the cause build for hanging issue.

How can I prevent a build from failing when trying to access a locally cached nuget package that is being lockedby another project in the same build?

We have CI set up on a solution within the company.
The build was taking roughly 13 minutes in total, which seemed a bit a too long. After some digging around, I found out that the we were not passing the /maxcpucount switch to the msbuild command, and so each project was being built in sequence as opposed to parallel. Adding this switch dropped our build time down to 3 minutes.
However, we started seeing builds intermittently failing with the message that a cached nuget package was already being used by another process. The project that would fail to build, and the locked nuget package would change every time.
This turned out to be because we were building multiple projects within the same solution at the same time, and we could get the circumstance whereby two projects building in parallel tried to access the same locally cached nuget package at the same time.
We surely can't be the only people with this problem, as it seems like it would be quite common. Does anyone have experience with this problem? Are we doing something wrong? How can we prevent these builds from failing?
So I finally figured what was causing this, although I can't figure out why.
In our Teamcity MSBuild step, we had our Working Directory set to %build.root%. Removing this value, so that the default of the checking directory was used, appears to have stopped that error from occurring.

msbuild slower than devenv

I'm experiencing performance inconsistencies with regards to build duration when building a VS2008 solution file with either devenv or msbuild from command line.
My solution contains both C# and C++ projects, and I have these results:
devenv.exe (either command line or within the ide): 7 minutes
msbuild.exe: 14 minutes
I tried tuning the msbuild switches passing /maxcpucount and /p:VCBuildAdditionalOptions=m# but with no luck so far.
Any idea?
MSBuild can be slower on VC projects. It does some gymnastics to build them, because they're not MSBuild format, and can't get much parallelism. Instead, try running VS on the command line- devenv.exe /build - if you need the performance. Or, upgrade to VS2010, because VC projects are natively built by MSBuild and you will get your performance back. It will typially be faster than VS.
Of course, the killer way to get build speed is to build only what has changed, and rely on incremental build. Most of the time, most developers should be doing quick incremental builds.
Dan
what is the full msbuild command you are running?
As a side point, have you got the build output turned down to Quiet or Minimal? That reduces build time a little...
7 minutes to build in the IDE!! Personally I'd go insane, debugging must be a nightmare :-|

Very long build time in Visual Studio

I've a solution with 15 projects (14 class libraries and one web application). Each class library has corresponding test project (i.e. if I have MyApp.Services project there exists MyApp.Services.Tests -- using NUnit). Everything is written in VB.NET. The problem is that when VS tries to compile any of *.Tests project it stops responding (the bigger the project the longer the period without reposnse). I don't know where to start looking for an issue. I'll add that I've R# 4.5 installed.
UPDATE 1:
Is there any way to benchmark a build in visual studio? To get build times for every project?
UPDATE 2:
It seems that there is no difference after disabling R#.
Try turning on verbose logging for the build
Tools...Options...Projects and Solutions...Build and Run..."MSBuild project build output verbosity"
This should help you get a better picture of what is going on.
Disabling Resharper will probably help.
As for the benchmark, try building with msbuild with the following options, it will print statistics on build process at the end.
msbuild yoursolution.sln /verbosity:diagnostic
Try closing the tool panes associated with unit testing.
Have you tried disabling Resharper 4.5, using the Tools->Addins menu, and tried building again?
Also, is there a difference in time if you shutdown VS, restart it and load your solution and try building again before you do anything else. It might be that the build times get slower over time?