-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Issue Description
When using RoslynCodeTaskFactory, MSBuild emits CS1701 and CS1702 assembly binding warnings for version mismatches (e.g., between System.Memory and System.Text.Json). The .NET SDK and Roslyn suppress these warnings by default because they are not actionable in modern .NET scenarios, but MSBuild does not. This leads to unnecessary warning noise and confusion in custom task or non-SDK builds.
References:
Steps to Reproduce
- Use RoslynCodeTaskFactory with a .cs file referencing mismatched System.Memory and System.Text.Json versions.
- Observe CS1701 and CS1702 warnings in MSBuild output (not present in .NET SDK-based builds).
Expected Behavior
Warnings CS1701 and CS1702 should be suppressed by default when RoslynCodeTaskFactory is running on .NET Core.
Actual Behavior
Warnings are emitted, unlike SDK-based builds.
Analysis
Aligning MSBuild with .NET SDK and Roslyn would simplify the experience for users and avoid confusion.
Versions & Configurations
See attached binlog and environment details in user reports.
User impact and context:
See roslyn#19640 for more details.