Skip to content

dotnet run file.cs / file-based app - environment variables available in directives #51499

@hammypants

Description

@hammypants

TL;DR:

I want to be able to do something like this:

#:project $(REPO_PATH)/path/to/project/Foo.csproj

This better enables these "file-based apps" to fit more of a "script" workflow across machines or users.

I note that in the XML based project files, this can already be done.

Example:

<ProjectReference Include="$(HOME)/some/folder/in/home/Foo.csproj" />

And that in the dotnet run file document these directives map to their equivalent csproj equivalents.

An aside: it's... very difficult, let's say, to do any real research on this feature due to not having a consistent, unambiguous name for the feature. I made an attempt to look for duplicates of this kind of request, or other issues where it might have been mentioned, but an overwhelming majority of items that show up have nothing to do with file-based apps, because dotnet run is quite the loaded command now. I did the same to see if this was already available somehow, too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions