Closed mruxmohan4 closed 1 month ago
@dfederm Can you advise here? It looks like possibly clash of multiple versions of MSBuild references - but I'd expect QuickBuild to use just single version of MSBuild. A dump of a repro would be helpful here
QuickBuild uses pre-release builds, updated weekly, for parsing. This is what we compile against. It uses the user-configured MSBuild for actually building projects.
For this specific scenario though, this is the project cache plugin for QuickBuild. So we're compiled against the prerelease version of MSBuild, but we're obviously in the MSBuild process of whatever the user is using.
So the problem here is that we must choose some version of MSBuild to compile against, but we have no control over the version of MSBuild being used at runtime. So the change with BuildRequestDataBase
causes a breaking change when the compile vs runtime are on different sides of the line.
Currently we are unable to update the MSBuild used in QuickBuild indefinitely until this issue is resolved.
Issue Description
When MSBuild is executed with the quickbuild project cache plugin enabled, a
System.TypeLoadException
is thrown nearly immediately after the QuickBuildProjectCachePlugin is loaded. Upon further inspection, this occurs when attempting to get the cache result. Instead of getting a proper cache hit where it normally would, the build results in cache misses and demonstrates that the build has completed successfully with the following warning.c:\src\CloudBuild\private\BuildEngine\Updater\src\QuickBuildUpdater.csproj : warning : Exception querying the QuickBuild project cache plugin. Treating as a cache miss. Exception: System.TypeLoadException: Could not load type 'Microsoft.Build.Execution.BuildRequestDataBase' from assembly 'Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
This issue began occurring only after the MSBuild package version was updated from
17.12.0-preview-24328-03
to17.12.0-preview-24354-03
.Steps to Reproduce
Command-line invocation:
set EnableQuickBuildCachePlugin=true
msbuild
Expected Behavior
Actual Behavior
Analysis
This appears directly related to https://github.com/dotnet/msbuild/pull/10172, which adds the
Microsoft.Build.Execution.BuildRequestDataBase
class and is the latest MSBuild change which has impacted that class.Versions & Configurations
Version of CLI tool:
Visual Studio 2022 Developer Command Prompt v17.11.0-pre.2.1