Skip to content

Conversation

@jjonescz
Copy link
Member

Tests and docs only change.

@jjonescz jjonescz added the Area-run-file Items related to the "dotnet run <file>" effort label Dec 11, 2025
@jjonescz jjonescz requested a review from Copilot December 11, 2025 12:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds test coverage and documentation for the dotnet run - feature (reading C# code from standard input). The changes clarify important behavioral aspects, specifically that the current working directory is used for building/executing even though it's not used to search for other files, and that $(MSBuildStartupDirectory) can be used to reference projects relative to the working directory.

  • Added test coverage verifying working directory behavior for dotnet run -
  • Added tests demonstrating that Directory.Build.props doesn't affect stdin-based runs (must use #:property directive instead)
  • Added tests showing project references work with $(MSBuildStartupDirectory) but not with simple relative paths
  • Enhanced documentation to explain working directory behavior and MSBuildStartupDirectory usage pattern

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
test/dotnet.Tests/CommandTests/Run/RunFileTests.cs Enhanced ReadFromStdin test to verify working directory and added two new tests (ReadFromStdin_BuildProps and ReadFromStdin_ProjectReference) to validate Directory.Build.props isolation and project reference behavior
documentation/general/dotnet-run-file.md Added clarification that working directory is still used for building/executing stdin programs and documented the $(MSBuildStartupDirectory) pattern for project references

Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-run-file Items related to the "dotnet run <file>" effort

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant