Skip to content

Replace Csc task with Roslyn API in FileTrackerTests#13094

Open
huulinhnguyen-dev wants to merge 3 commits intodotnet:mainfrom
huulinhnguyen-dev:dev/huulinhnguyen/fix_csc_task_usage_in_the_FileTrackerTests
Open

Replace Csc task with Roslyn API in FileTrackerTests#13094
huulinhnguyen-dev wants to merge 3 commits intodotnet:mainfrom
huulinhnguyen-dev:dev/huulinhnguyen/fix_csc_task_usage_in_the_FileTrackerTests

Conversation

@huulinhnguyen-dev
Copy link
Copy Markdown
Contributor

@huulinhnguyen-dev huulinhnguyen-dev commented Jan 23, 2026

Fixes #12063

Context

The FileTrackerTests.cs contains tests that depend on Microsoft.CodeAnalysis.BuildTasks.Csc from the discontinued Microsoft.CodeAnalysis.Build.Tasks NuGet package. This blocks the code from compiling when the ENABLE_TRACKER_TESTS flag is enabled.

Changes Made

  • Added Microsoft.CodeAnalysis.CSharp package reference
  • Created CompileCSharpExecutable() helper method using Roslyn API
  • Replaced all Csc task usages with the new helper method
  • Removed #if ENABLE_TRACKER_TESTS

Testing

  • Added CompileCSharpExecutable_CompilesSimpleProgram test to verify the helper method works correctly

Notes

@huulinhnguyen-dev huulinhnguyen-dev marked this pull request as ready for review January 30, 2026 10:55
@huulinhnguyen-dev huulinhnguyen-dev requested a review from a team as a code owner January 30, 2026 10:55
Comment thread eng/Versions.props Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix Csc task usage in the FileTrackerTests.cs

3 participants