Skip to content

[enhancement]: Add support for dotnet run app.cs with inline (script) code #21740

@IanKemp

Description

@IanKemp

Task name

DotNetCoreCLI@2

Describe your feature request here

.NET 10 adds the dotnet run app.cs feature that allows for executing programs without the need for a csproj. The DotNetCoreCLI@2 task obviously supports this natively, but what would be ideal is if this task also supported inline C# code - similarly to how the PowerShell@2 task supports a script argument, that outputs that code to a temporary file, then executes it.

An example of how this could be implemented can be found here on line 15 - credit to @fvilches17 for the POC.

Syntax would ideally be similar or identical to PowerShell@2, so something like

- task: DotNetCoreCLIV2
  command: run
  inputs:
    targetType: inline
    script: |
      Console.WriteLine("Hello World");

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