msbuild: Build fails when try to process the bundleconfig.json

We have CI setup in VSTS and all of a sudden. Even on previously successful builds.

The build started failing when it tries to process the bundleconfig.json I can confirm we don’t have any changes in that file and previous builds were successful. The build fails at the same point even if I try to rebuild branches where it was successful.

SYSTEM CAPABILITIES Shows information about the capabilities provided by this host Capability name Capability value Agent.Name Hosted VS2017 2 Agent.Version 2.134.2 AndroidSDK C:\Program Files (x86)\Android\android-sdk ant C:\java\ant\apache-ant-1.9.7 AzurePS 3.6.0 Cmd C:\Windows\system32\cmd.exe curl C:\Program Files\Git\mingw64\bin\curl.exe DotNetFramework C:\Windows\Microsoft.NET\Framework64\v4.0.30319 GTK_BASEPATH C:\Program Files (x86)\GtkSharp\2.12
java C:\Program Files (x86)\Java\jdk1.8.0_112 jdk C:\Program Files (x86)\Java\jdk1.8.0_112 jdk_8 C:\Program Files (x86)\Java\jdk1.8.0_112 maven C:\java\maven\apache-maven-3.2.2 MSBuild C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin
node.js C:\Program Files\nodejs\node.exe npm C:\Program Files\nodejs\npm.cmd SqlPackage C:\Program Files\Microsoft SQL Server\140\DAC\bin\SqlPackage.exe VisualStudio C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise
VSTest C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow Xamarin.Android 7.2.0.7

Error logs Bundler: Begin processing bundleconfig.json Build FAILED. …

MSBUILD : error MSB1025: An internal failure occurred while running MSBuild. Microsoft.Build.Shared.InternalErrorException: MSB0001: Internal MSBuild Error: ContextID 22 should have been in the ID-to-project file mapping but wasn’t! at Microsoft.Build.Shared.ErrorUtilities.ThrowInternalError(String message, Object[] args) at Microsoft.Build.BackEnd.Logging.LoggingService.GetAndVerifyProjectFileFromContext(BuildEventContext context) at Microsoft.Build.BackEnd.Logging.LoggingService.LogBuildEvent(BuildEventArgs buildEvent) at Microsoft.Build.BackEnd.TaskHost.LogErrorEvent(BuildErrorEventArgs e) at Microsoft.Build.Utilities.TaskLoggingHelper.LogError(String subcategory, String errorCode, String helpKeyword, String file, Int32 lineNumber, Int32 columnNumber, Int32 endLineNumber, Int32 endColumnNumber, String message, Object[] messageArgs) at BundlerMinifier.BundlerBuildTask.BundleMinifier_ErrorMinifyingFile(Object sender, MinifyFileEventArgs e) at BundlerMinifier.BundleMinifier.MinifyBundle(Bundle bundle) at BundlerMinifier.BundleFileProcessor.ProcessBundle(String baseFolder, Bundle bundle) at BundlerMinifier.BundleFileProcessor.Process(String fileName, IEnumerable1 bundles) at BundlerMinifier.BundlerBuildTask.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) at Microsoft.Build.BackEnd.TaskBuilder.InitializeAndExecuteTask(TaskLoggingContext taskLoggingContext, ItemBucket bucket, IDictionary2 taskIdentityParameters, TaskHost taskHost, TaskExecutionMode howToExecuteTask) at Microsoft.Build.BackEnd.TaskBuilder.ExecuteBucket(TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Dictionary2 lookupHash) at Microsoft.Build.BackEnd.TaskBuilder.ExecuteTask(TaskExecutionMode mode, Lookup lookup) at Microsoft.Build.BackEnd.TaskBuilder.ExecuteTask(TargetLoggingContext loggingContext, BuildRequestEntry requestEntry, ITargetBuilderCallback targetBuilderCallback, ProjectTargetInstanceChild taskInstance, TaskExecutionMode mode, Lookup inferLookup, Lookup executeLookup, CancellationToken cancellationToken) at Microsoft.Build.BackEnd.TargetEntry.ProcessBucket(ITaskBuilder taskBuilder, TargetLoggingContext targetLoggingContext, TaskExecutionMode mode, Lookup lookupForInference, Lookup lookupForExecution) at Microsoft.Build.BackEnd.TargetEntry.ExecuteTarget(ITaskBuilder taskBuilder, BuildRequestEntry requestEntry, ProjectLoggingContext projectLoggingContext, CancellationToken cancellationToken) at Microsoft.Build.BackEnd.TargetBuilder.ProcessTargetStack(ITaskBuilder taskBuilder) at Microsoft.Build.BackEnd.TargetBuilder.BuildTargets(ProjectLoggingContext loggingContext, BuildRequestEntry entry, IRequestBuilderCallback callback, String[] targetNames, Lookup baseLookup, CancellationToken cancellationToken) at Microsoft.Build.BackEnd.RequestBuilder.BuildProject() at Microsoft.Build.BackEnd.RequestBuilder.BuildAndReport() at Microsoft.Build.BackEnd.RequestBuilder.RequestThreadProc(Boolean setThreadParameters) MSBUILD : error MSB1025: An internal failure occurred while running MSBuild. Microsoft.Build.Shared.InternalErrorException: MSB0001: Internal MSBuild Error: ContextID 22 should have been in the ID-to-project file mapping but wasn’t! at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary2 globalProperties, Dictionary2 restoreProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, Boolean detailedSummary, ISet1 warningsAsErrors, ISet1 warningsAsMessages, Boolean enableRestore, ProfilerLogger profilerLogger, Boolean enableProfiler) at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine) Unhandled Exception: Microsoft.Build.Shared.InternalErrorException: MSB0001: Internal MSBuild Error: ContextID 22 should have been in the ID-to-project file mapping but wasn’t! at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary2 globalProperties, Dictionary2 restoreProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, Boolean detailedSummary, ISet1 warningsAsErrors, ISet`1 warningsAsMessages, Boolean enableRestore, ProfilerLogger profilerLogger, Boolean enableProfiler) at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine) at Microsoft.Build.CommandLine.MSBuildApp.Main(String[] args)

Any suggestions what went wrong!?

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 24 (4 by maintainers)

Most upvoted comments

It turned out the problem is the BundlerMinifier NuGet package. After switching to BundlerMinifier.Core version everything builds. I don’t know why that happened all of a sudden.

As suggested in madskristensen/BundlerMinifier#365, setting the environment variable MSBUILDDISABLENODEREUSE to 1 is a workaround for this issue.

Passing MSBUILDDISABLENODEREUSE=1 as a user secret solved the issue in development. On Ubuntu 18.04.02 with .NetCore 2.2

Unfortunately just wasted a good two hours on this issue, any chance it’s going to be fixed soon? Mac OS X,

~:$ dotnet --version
2.2.103

Sorry and thanks!

@rainersigwald I started getting this error on Azure DevOps after I converted my project from .net core 2.2 to .net core 3.0. It’s not consistent. Usually the build works.

It looks like it can be triggered by doing “dotnet clean” and then “dotnet build” (not every time, but often). After it successfully builds the project once, subsequent builds seem to mostly work. I added the clean step to my DevOps build after upgrading to core 3.0, so it was maybe therefore I see the error more often now.

I’ll try to create a sample to repro this and post it here later.