Move ALL shared files to Framework so that Utilities, Tasks, Build, and MSBuild projects get shared code through Framework only (not direct Shared references).
Migration is MOSTLY FEASIBLE - Only 4-5 files blocked by TaskLoggingHelper.
ErrorUtilities, ResourceUtilities, FileUtilities have NO Utilities dependencies!
- They only depend on Framework
- Can be moved to Framework without circular dependencies
- This unblocks ~50+ other Category 1 files
Framework (would contain Shared files)
↓
PropertyParser, PlatformNegotiation (only 4 Shared files affected)
↓
TaskLoggingHelper (Utilities public API)
↓
Framework (Utilities depends on Framework)
Only 4-5 files have this circular dependency.
TaskLoggingHelper is defined in src/Shared/TaskLoggingHelper.cs but is compiled as:
- Public class in
Microsoft.Build.Utilitiesnamespace (Utilities DLL) - Public API - exposed to all MSBuild tasks through
Task.Logproperty
Shared files that depend on it:
PropertyParser.csPlatformNegotiation.csTaskLoggingHelperExtension.csAssemblyFolders/AssemblyFoldersFromConfig.cs
Answer: It DOES.
Utilities contains TaskLoggingHelper (public API) which IS referenced by Shared files.
Answer: MOSTLY TRUE (corrected).
Only 2 files have public visibility:
IMSBuildElementLocation.cs- Only compiled in Framework, not truly sharedNodeEngineShutdownReason.cs- Can move file, namespace doesn't need to change
Previous analysis was WRONG - these are actually INTERNAL:
FileMatcher.cs- internalReadOnlyEmptyDictionary.cs- internalFileSystem/WindowsNative.cs- internal
- ✅ CanonicalError.cs
- ✅ FileDelegates.cs
- ✅ VersionUtilities.cs
- ✅ AssemblyFolders/Serialization/AssemblyFolderCollection.cs
- ✅ AssemblyFolders/Serialization/AssemblyFolderItem.cs
- ✅ ErrorUtilities, ResourceUtilities, FileUtilities (foundational, no Utilities deps)
- ✅ All Category 1 files except TaskLoggingHelper-dependent ones
- ✅ Includes: FrameworkLocationHelper, FileMatcher, Registry files, etc.
- ❌ TaskLoggingHelper.cs (Utilities public API)
- ❌ PropertyParser.cs
- ❌ PlatformNegotiation.cs
- ❌ TaskLoggingHelperExtension.cs
- ❌ AssemblyFoldersFromConfig.cs
Move ~54 Category 1 files to Framework:
- ErrorUtilities, ResourceUtilities, FileUtilities (no Utilities deps!)
- All Category 1 files except 4-5 TaskLoggingHelper-dependent ones
- 46% reduction in duplication
- No breaking changes required
- Achieves stated goal for most files
- Keep current 5 files
- Add 10-15 more simple files (Registry, interfaces, extensions)
- ~15-20% reduction
- Lower implementation risk
If breaking changes acceptable:
- Move TaskLoggingHelper to Framework
- Change namespace to Microsoft.Build.Framework
- Move remaining 4-5 files
- Requires major version bump
- Achieves 100% migration goal
See SHARED_TO_FRAMEWORK_MIGRATION.md for complete analysis including:
- List of all 117 shared files
- Dependency analysis
- Conditional compilation details
- Architecture diagrams
The goal of moving shared files to Framework CAN MOSTLY be achieved:
- 54 of 58 Category 1 files can move (93% of goal)
- Only 4-5 files blocked by TaskLoggingHelper dependency
- ErrorUtilities has no circular dependency - it can move!
- This enables ~46% reduction in duplication
Corrected Understanding:
- Previous analysis incorrectly thought ErrorUtilities blocked migration
- ErrorUtilities only depends on Framework, not Utilities
- This unblocks the majority of shared files
Next Steps:
- Move ErrorUtilities, ResourceUtilities, FileUtilities to Framework
- Move all other Category 1 files except TaskLoggingHelper-dependent ones
- Update project references
- Achieve 46% reduction without breaking changes