[Bug]: Evaluation of a project with an ProjectCachePlugin
item impacts the next build, regardless of its involvement in the build.
#10615
Labels
Area: Engine
Issues impacting the core execution of targets and tasks.
Area: Project Cache
bug
triaged
Issue Description
Merely evaluating a Project (even in a private
ProjectCollection
) that produces anProjectCachePlugin
item has the nasty side-effect of impacting the next build, even though that project is never built.And in particular, it breaks attempts to programmatically enable the MSBuildCache plugin because it is very particular about only being initialized once, yet it is loaded twice in my testing because MSBuild allowed a single evaluation of an isolated project to also impact the build.
Steps to Reproduce
This code breaks the next build, yet is a natural way to reuse the plugin's defaults as defined in the plugin's nuget package:
Expected Behavior
A successful build.
Actual Behavior
The build fails with this message:
Analysis
@dfederm says msbuild stores the plugin in a mutable static (evil) just from seeing an
ProjectCachePlugin
item in any project evaluation.Versions & Configurations
Dev17.12 (35228.240.main)
The text was updated successfully, but these errors were encountered: