I've researched this issue for a few days with no answer. There are references to the error code but I believe that BC2000 is used for all "compiler initialization" errors, regardless of the underlying issue.
I have a VS solution that compiles just fine in our dev environment with MSBuild 12.0. However, when trying to compile in our Win 2008 R2 SP1 build machine using MSBuild 12.0, we get a fatal error.
The command being executed for MSBuild is:
"C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe" "path\to\solution.sln" /target:Clean;Build /verbosity:normal /toolsversion:12.0 /nologo /property:WarningLevel="2" /property:Configuration="Release"
The error received is:
vbc: Error: Fatal error BC2000 : compiler initialization failed unexpectedly: Project already has a reference to assembly Microsoft.VisualBasic. A second reference to 'path\to\dotnet4\System.dll' cannot be added. (Fatal error BC2000)
This is similar to this question. However, we don't have the setup their using as we're not using Mono.
The project in question has only one reference to Microsoft.VisualBasic assembly. Also, the vbc commands being executed are similar in the dev and build machines, and they only refer to the mentioned assembly once.
Same for dev and build machines:
- .NET Framework version: 4.6.1
- MSBuild being used: 12.0
Different:
- Dev machines have either VS 2010 or VS 2013.
- Build machine does not have VS installed.
- Build machine also has MS Visual C++ Build Tools 2015 installed.
Has anybody come across this issue before? Any ideas on how to fix it? Thanks.