randomsolutions;8946 wrote:My team is also having the issues described in this thread ever since upgrading to VS2015. Doing the build property change mentioned above seems to have fixed it.
Thanks for confirming this. I have a theory here now on what is happening here.
The VBCSCompiler.exe process is a 'shared' process that is started by the first invocation to MSBuild/CSC/VBC, basically when a project gets built by Roslyn.
This process stays resident for a period of time. If it's left idle long enough, it will self-terminate. I'm not sure what the threshold is for this, but I presume upwards of 15 minutes.
The process is used to perform ALL compile steps for any code compiled on the machine it's running on, and it is not externally managed in any way (i.e. if you shut down VS, the process lives on).
If the process is launched outside the context of NCrunch (i.e. your first build on the machine is done in VS or using a different tool), it is launched with the CPU affinity and processing prioritisation of the calling process, which would normally allow it to run under ALL CPUs on the system and at standard priority. For NCrunch, this is a really bad thing because it means the process can steal CPU away from VS. I expect that on a lower end system (or higher end system running at full capacity) you will see a performance issue appear as a result of this.
If the VBCSCompiler process is launched by NCrunch (i.e. your first build on the machine is performed by NCrunch), it will inherit the processing attributes of NCrunch itself, and it should steer clear of the CPU cores that have been reserved for VS.
So basically, you may be able to avoid the performance issue entirely by ensuring your first build is performed by NCrunch. If you leave your desk for a period of time and come back, make sure that NCrunch is used for the next build so that the process always has the correct processing attributes.
I have a fix in the works for this as part of the 2.24 release, which I'm hoping to kick out within the next couple of weeks. If you're interested in trying the above, please let me know how it goes.