Design-time builds in CPS are doing too much work because BuildingProject is set to true
- Dominant language
- C#
- Stars
- 5.5k
- Forks
- 1.5k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 141
Description
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.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.