-
Notifications
You must be signed in to change notification settings - Fork 1.2k
File-based apps: consider args in simple csc optimization #50779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release/10.0.1xx
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Fixes an issue where file-based C# apps were not properly passing command-line arguments when using the CSC optimization path. The PR ensures that when dotnet run
uses the direct CSC compilation approach for file-based apps, the application arguments are correctly forwarded to the executed program.
- Modifies the
CreateCommandForCscBuiltProgram
method to accept and properly escape application arguments - Updates the method call site to pass the
ApplicationArgs
parameter - Adds comprehensive test coverage for the CSC-only path with arguments
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/Cli/dotnet/Commands/Run/RunCommand.cs | Updates CSC optimization path to properly handle application arguments |
test/dotnet.Tests/CommandTests/Run/RunFileTests.cs | Adds test cases to verify argument passing works correctly in CSC-only scenarios |
@333fred for a review of a simple change, thanks |
var programPath = Path.Join(testInstance.Path, "Program.cs"); | ||
|
||
var code = $""" | ||
#:property Configuration=Release |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the purpose of this flag in this test?
Fixes #50778.