Skip to content

Design-time builds in CPS are doing too much work because BuildingProject is set to true #2417

Open
@davkean

Description

@davkean

To reduce build times, CPS groups build targets for a project together. This has the unintended side-effect of turning $(BuildingProject) on during lots of CPS design-time builds.

Lots of behavior in common targets is driven by $(BuildingProject), it's basically the legacy equivalent of $(DesignTimeBuild) != 'true'":

186>------ Build started: Project: Microsoft.VisualStudio.ProjectSystem.Managed, Targets: CollectResolvedSDKReferencesDesignTime, DebugSymbolsProjectOutputGroup, CollectPackageReferences, ResolveComReferencesDesignTime, ContentFilesProjectOutputGroup, DocumentationProjectOutputGroupDependencies, SGenFilesOutputGroup, ResolveProjectReferencesDesignTime, SourceFilesProjectOutputGroup, DebugSymbolsProjectOutputGroupDependencies, SatelliteDllsProjectOutputGroup, BuiltProjectOutputGroup, SGenFilesOutputGroupDependencies, ResolveAssemblyReferencesDesignTime, CollectAnalyzersDesignTime, CollectSDKReferencesDesignTime, DocumentationProjectOutputGroup, PriFilesOutputGroup, BuiltProjectOutputGroupDependencies, ResolvePackageDependenciesDesignTime, SatelliteDllsProjectOutputGroupDependencies, SDKRedistOutputGroup, CompileDesignTime, CollectResolvedCompilationReferencesDesignTime ------

...

186>Target "BuildOnlySettings" in file "C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets":
186>  Set Property: BuildingProject=true

BuildOnlySettings is basically a dependency of most of the output groups targets.

Things that I'm seeing we're doing:

  • ResolveAssemblyReferences; FindDependencies, FindSatellites, FindSerializationAssemblies, FindRelatedFiles is all true.
  • ResolveAssemblyReferences; Silent is false - undecided if this is good or bad.

This would explain why ResolveAssemblyReferences is showing up on traces, FindDependencies is very slow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions