Skip to content

Remove feature flag for transitive #: directives#54012

Open
jjonescz wants to merge 2 commits intodotnet:release/10.0.4xxfrom
jjonescz:sprint-transitive-not-experimental
Open

Remove feature flag for transitive #: directives#54012
jjonescz wants to merge 2 commits intodotnet:release/10.0.4xxfrom
jjonescz:sprint-transitive-not-experimental

Conversation

@jjonescz
Copy link
Copy Markdown
Member

Follow up on #53775 (comment).

Copilot AI review requested due to automatic review settings April 21, 2026 12:08
@jjonescz jjonescz added the Area-run-file Items related to the "dotnet run <file>" effort label Apr 21, 2026
Copy link
Copy Markdown
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

Removes the feature-flag gating for processing transitive file-level #: directives in file-based programs, aligning implementation, tests, and docs with the new default behavior.

Changes:

  • Stop checking ExperimentalFileBasedProgramEnableTransitiveDirectives when validating directives (transitive directives always allowed).
  • Update dotnet run file tests to no longer set the transitive-directives flag and remove the flag-specific test.
  • Remove the flag constant from the FileBasedPrograms internal API surface and update documentation accordingly.

Reviewed changes

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

Show a summary per file
File Description
test/dotnet.Tests/CommandTests/Run/RunFileTests.cs Removes transitive-directive flag setup and deletes the test that asserted the flag gating behavior.
src/Microsoft.DotNet.ProjectTools/VirtualProjectBuilder.cs Removes the runtime check that required the transitive-directives flag for non-entry-point directives.
src/Cli/Microsoft.DotNet.FileBasedPrograms/InternalAPI.Unshipped.txt Drops the internal API entry for the removed flag constant.
src/Cli/Microsoft.DotNet.FileBasedPrograms/FileLevelDirectiveHelpers.cs Removes the transitive-directives flag constant from CSharpDirective.IncludeOrExclude.
documentation/general/dotnet-run-file.md Removes documentation that stated transitive directives were gated behind a feature flag.

@jjonescz jjonescz requested a review from a team April 21, 2026 12:29
@DamianEdwards
Copy link
Copy Markdown
Member

Are we going to get this into 10.0.300 as well?

@jjonescz
Copy link
Copy Markdown
Member Author

jjonescz commented Apr 21, 2026

IIRC, code complete of 10.0.3xx was yesterday. Also the IDE integration is probably not even released yet.

@DamianEdwards
Copy link
Copy Markdown
Member

We should check on the code complete status and if there's a process for getting changes in still. On the IDE side they release far more often and the experience in the insiders and pre-release versions is already good and we can do follow ups to tweak the experience as needed. Is the opt-in flag for transitive directives removed for .NET 11 already?

@jjonescz
Copy link
Copy Markdown
Member Author

Is the opt-in flag for transitive directives removed for .NET 11 already?

No, but this PR will flow there once merged.

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.

3 participants