Skip to content

[release/10.0.1xx-preview6] Prefer CLI commands to loose files #49487

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

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jun 19, 2025

Backport of #49485 to release/10.0.1xx-preview6

Customer Impact

The work to add support for running single-file apps from a direct dotnet invocation (dotnet app.cs) introduces a regression in the way built-in commands are executed. A file that matches the detection criteria for single-file apps that has the same name as one of our built-in commands would be prioritized over the built-in command.

Regression

No, this was introduced in p6 and is being fixed in p6, so no users would have encountered this behavior yet.

Testing

Manual testing: what this shows is that while we can run a single-file app with a name matching one of our built-in commands, we can no longer implicitly run it - dotnet run dnx works, but dotnet dnx runs our dnx command as expected.

(dogfood) PS E:\Code\Scratch\foo> dotnet run dnx
    E:\Code\Scratch\foo\dnx.csproj : error NU1102:
      Unable to find package Microsoft.NET.ILLink.Tasks with version (>= 10.0.0-preview.6.25316.103)
        - Found 54 version(s) in nuget [ Nearest version: 10.0.0-preview.5.25277.114 ]

The build failed. Fix the build errors and run again.
(dogfood) PS E:\Code\Scratch\foo> dotnet dnx
Required argument missing for command: 'dnx'.

Description:
  Executes a tool from source without permanently installing it.

Usage:
  dotnet dnx <packageId> [<commandArguments>...] [options]

Arguments:
  <PACKAGE_ID>        Package reference in the form of a package identifier like 'Newtonsoft.Json' or package identifier and version separated by '@' like 'Newtonsoft.Json@13.0.3'.
  <commandArguments>  Arguments forwarded to the tool

Options:
  --version <VERSION>       The version of the tool package to install.
  -y, --yes                 Accept all confirmation prompts using "yes."
  --interactive             Allows the command to stop and wait for user input or action (for example to complete authentication). [default: True]
  --allow-roll-forward      Allow a .NET tool to roll forward to newer versions of the .NET runtime if the runtime it targets isn't installed.
  --prerelease              Include pre-release packages.
  --configfile <FILE>       The NuGet configuration file to use.
  --source <SOURCE>         Replace all NuGet package sources to use during installation with these.
  --add-source <ADDSOURCE>  Add an additional NuGet package source to use during installation.
  --disable-parallel        Prevent restoring multiple projects in parallel.
  --ignore-failed-sources   Treat package source failures as warnings.
  --no-http-cache           Do not cache packages and http requests.
  -v, --verbosity <LEVEL>   Set the MSBuild verbosity level. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic].
  -?, -h, --help            Show command line help.

Risk

Low, this change is very scoped and only impacts the single-file-run-from-dotnet use case.

@baronfel baronfel enabled auto-merge (squash) June 19, 2025 17:38
@marcpopMSFT marcpopMSFT disabled auto-merge June 19, 2025 17:38
@marcpopMSFT marcpopMSFT merged commit 7058ff2 into release/10.0.1xx-preview6 Jun 19, 2025
30 of 31 checks passed
@marcpopMSFT marcpopMSFT deleted the backport/pr-49485-to-release/10.0.1xx-preview6 branch June 19, 2025 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants