Ensure csc.rsp is always written to disk with dotnet run and dotnet build#53235
Merged
jjonescz merged 10 commits intorelease/10.0.3xxfrom Mar 10, 2026
Merged
Ensure csc.rsp is always written to disk with dotnet run and dotnet build#53235jjonescz merged 10 commits intorelease/10.0.3xxfrom
jjonescz merged 10 commits intorelease/10.0.3xxfrom
Conversation
Co-authored-by: jjonescz <3669664+jjonescz@users.noreply.github.com>
…ckly Co-authored-by: jjonescz <3669664+jjonescz@users.noreply.github.com>
Copilot stopped work on behalf of
jjonescz due to an error
March 3, 2026 18:53
This was referenced Mar 3, 2026
Open
jjonescz
reviewed
Mar 3, 2026
src/Microsoft.CodeAnalysis.NetAnalyzers/src/Microsoft.CodeAnalysis.NetAnalyzers.sarif
Show resolved
Hide resolved
…hange Co-authored-by: jjonescz <3669664+jjonescz@users.noreply.github.com>
jjonescz
reviewed
Mar 3, 2026
src/Microsoft.CodeAnalysis.NetAnalyzers/src/Microsoft.CodeAnalysis.NetAnalyzers.sarif
Show resolved
Hide resolved
…ublic API Co-authored-by: jjonescz <3669664+jjonescz@users.noreply.github.com>
Contributor
Author
Copilot
AI
changed the title
[WIP] Ensure csc.rsp is always written to disk with dotnet run
Ensure csc.rsp is always written to disk with dotnet run
Mar 3, 2026
jjonescz
approved these changes
Mar 4, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR ensures dotnet run <file>.cs produces a csc.rsp on disk even when the build goes through the full MSBuild path, enabling IDEs to consume compiler arguments for faster virtual project setup (per the Roslyn issue).
Changes:
- Write
csc.rspafter successful MSBuild builds by persisting cached CSC arguments. - Factor
csc.rspwriting/path logic into a shared helper (WriteCscRspFile/GetCscRspPath). - Add a test verifying
csc.rspexists and is non-empty after an MSBuild build.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| test/dotnet.Tests/CommandTests/Run/RunFileTests.cs | Adds coverage asserting csc.rsp is created after a full MSBuild build. |
| src/Cli/dotnet/Commands/Run/VirtualProjectBuildingCommand.cs | Writes csc.rsp after MSBuild builds using cached CSC arguments. |
| src/Cli/dotnet/Commands/Run/CSharpCompilerCommand.cs | Introduces shared helper to write csc.rsp and centralizes rsp path construction. |
…esCscRsp test Co-authored-by: jjonescz <3669664+jjonescz@users.noreply.github.com>
Copilot
AI
changed the title
Ensure csc.rsp is always written to disk with dotnet run
Ensure csc.rsp is always written to disk with dotnet run and dotnet build
Mar 4, 2026
RikkiGibson
approved these changes
Mar 4, 2026
This was referenced Mar 4, 2026
jjonescz
reviewed
Mar 4, 2026
… when no targets specified Co-authored-by: jjonescz <3669664+jjonescz@users.noreply.github.com>
jjonescz
reviewed
Mar 4, 2026
…s for CoreCompile Co-authored-by: jjonescz <3669664+jjonescz@users.noreply.github.com>
333fred
reviewed
Mar 9, 2026
333fred
approved these changes
Mar 9, 2026
Co-authored-by: Fred Silberberg <frsilb@microsoft.com>
Member
|
@MiYanni for a review, thanks |
MiYanni
approved these changes
Mar 10, 2026
This was referenced Mar 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
csc.rspafter MSBuild builds (bothdotnet run file.csanddotnet build file.cs)WriteCscRspFile/GetCscRspPathintoCSharpCompilerCommandas shared helpersBuilder.RequestedTargetsempty-array bug withis { Length: > 0 }checkSkipNonexistentTargetsflag so multi-target outer builds (noCoreCompile) don't failMSBuild_WritesCscRspandDotnetBuild_WritesCscRsptestsBuild_Library_MultiTarget,Build_Exe_MultiTarget, new csc.rsp tests)💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.