Skip to content

Running file-based app using repo-local dotnet install performs restore for .proj file in root of repo #49790

@DamianEdwards

Description

@DamianEdwards

When using a repo-local install of the dotnet CLI, e.g. like that in the dotnet/runtime repo, attempting to run a file-based app using an absolute path to a completely different location from the repo results in the project file in the repo being restored.

Repro:

  1. Clone https://github.com/dotnet/runtime
  2. In the repo root, run dotnet.cmd or dotnet.sh to install the repo-local copy of the dotnet CLI
  3. Create a directory in the drive root like scripts and put a hello world file-based app in it named hello.cs
  4. From the repo root, run .\.dotnet\dotnet run D:\scripts\hello.cs (or simply dotnet run D:\scripts\hello.cs)
  5. Note that restore runs for projects in the repo (likely from the Build.proj in the repo root)

Metadata

Metadata

Assignees

Labels

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

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions