6

Environment

I'm using Visual Studio 2019 version 16.7.2 on a Windows 10 VM, hosted by Parallels on a brand new MacBook Pro. The VM has eight virtual processors and sixteen gigs of RAM.

Nothing other than Visual Studio is installed on the VM.

What I'm trying to do

I'm trying to compile a Visual Studio solution consisting of seventeen projects. The projects are relatively small. They're all C# console applications or DLL libraries targeting .NET Core 3.1.

Problem

Typically a Rebuild Solution executed after a Clean Solution takes place in about ten seconds. A typical Build Solution (Ctl-Shft-B) that I execute throughout the day takes place almost instantaneously.

But occasionally, in maybe one build out of five, building the solution/projects causes VBCSCompiler.exe to consume 99% CPU usage and freeze up for approximately thirty to forty-five seconds prior to executing the build. Once it starts executing the build though, everything completes normally. This long delay which occurs time and time again is making my development cycle terribly frustrating. I'd like to find a way to eliminate this delay.

What's Changed

The build executed fine on my Amazon Web Server Windows 2016 m4.xlarge VM. I recently switched over to the Parallels VM to save money. That's when the problem began.

Again, I want to reiterate that the Parallels VM is clean. Nothing other than Visual Studio is installed there.

What I've Tried

The following tactics were applied to no avail.

(1) I turned off the Defender real-time virus checker.

(2) Based on the information in this post, I went to Tools | Options | Nuget Package Manager | General, and unchecked 'Allow Nuget to download missing packages' and 'Automatically check for missing packages'

(3) In Tools | Options | Projects and Solutions | Build and Run, I set the maximum number of parallel projects builds to one.

(4) Based on an answer to an unrelated question, I learned that I can view more information about the build process by setting 'MS Build project build output verbosity' to Detailed. I did so. I waited for the freeze to occur so I could examine the last line of output prior to the freeze. It reads as follows:

Using shared compilation with compiler from directory: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Roslyn

This line always appears immediately before a freeze.

(5) Based on the output above, I Googled 'shared compilation' and discovered this post.

As a hobbyist programmer, the discussion that took place there, as well as the link in the accepted answer is well above my pay grade. It's unintelligible to me. If the answer lives in that post, I can't decipher it.

Any ideas on how to solve this intermittent freeze? If I can't figure it out, I'll have to assume it's something about my Parallels Windows 10 VM that's causing the problem, and revert back to developing on an Amazon server. I'd prefer to avoid that if possible because of the added expense.

Thanks for your consideration.

Best,

Festus

Festus Martingale
  • 539
  • 1
  • 3
  • 12

0 Answers0