Skip to content

Environment.GetCommandLineArgs()[0] points to non-existing file in single-file apps #40874

@jkotas

Description

@jkotas

Repro:

using System;

class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine(Environment.GetCommandLineArgs()[0]);
    }
}
  1. dotnet publish -r win-x64 --self-contained=false /p:PublishSingleFile=true
  2. bin\Debug\net5.0\win-x64\publish\zzz.exe

Actual result:
c:\test\bin\Debug\net5.0\win-x64\publish\zzz.dll

Expected result:
path to file that physically exists on disk

Metadata

Metadata

Assignees

Labels

untriagedNew issue has not been triaged by the area owner

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions