Skip to content

Conversation

jjonescz
Copy link
Member

@jjonescz jjonescz commented Oct 1, 2025

Fixes #51077.

@jjonescz jjonescz added the Area-run-file Items related to the "dotnet run <file>" effort label Oct 1, 2025
Copy link
Contributor

github-actions bot commented Oct 1, 2025

This PR is targeting main, which is now for .NET 11-facing work. If you intended to target .NET 10, either retarget this PR to release/10.0.1xx or make sure you backport the change to release/10.0.1xx after merging. See #50394 for more details.

@jjonescz jjonescz changed the base branch from main to release/10.0.1xx October 1, 2025 10:05
@jjonescz jjonescz marked this pull request as ready for review October 1, 2025 11:26
@jjonescz jjonescz requested review from a team and Copilot October 1, 2025 11:26
Copy link
Contributor

@Copilot 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 allows file-level directive values to be empty in .NET CLI commands. The change addresses issue #51077 by modifying the directive parsing logic to handle empty values instead of treating them as missing values.

Key Changes

  • Updated directive parsing logic to distinguish between missing and empty values
  • Added comprehensive test coverage for empty directive values across different directive types

Reviewed Changes

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

File Description
src/Cli/dotnet/Commands/Run/VirtualProjectBuildingCommand.cs Modified ParseOptionalTwoParts method to return empty string for whitespace-only values instead of null
test/dotnet.Tests/CommandTests/Project/Convert/DotnetProjectConvertTests.cs Added test method Directives_EmptyValue to verify empty directive values are handled correctly

@jjonescz
Copy link
Member Author

jjonescz commented Oct 2, 2025

@RikkiGibson @333fred @MiYanni for reviews, thanks

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.

File-level directives do not allow empty values
1 participant