Skip to content

crossgen2 rejects input files whose extension is uppercase (.DLL/.EXE) #132554

Closed

Description

@estrizhok

Description

When publishing a self-contained application with PublishReadyToRun=true, crossgen2 throws Input file with '.DLL' extension not supported if the input assembly's path ends with an uppercase extension. This happens on filesystems where the actual on-disk filename is returned in uppercase (for example, a WinFsp/virtiofs share on Windows that normalizes names to uppercase).

Repro steps

  1. On Windows, place a net10.0 console project on a virtiofs/WinFsp share that returns files with uppercase extensions (so dir /x shows BBS.CMD.DLL instead of Bbs.Cmd.dll).
  2. Publish with ReadyToRun enabled:
dotnet publish -c Release -r win-x64 -p:PublishReadyToRun=true
  1. The build fails during the R2R step.

Expected behavior

crossgen2 should treat .DLL, .Dll, .EXE, etc. as valid managed-assembly extensions, just like earlier versions did.

Actual behavior

Build fails with:

Microsoft.NET.CrossGen.targets(467,5): error : Error: Input file with '.DLL' extension not supported
System.CommandLine.CommandLineException: Input file with '.DLL' extension not supported
   at ILCompiler.Program.RunSingleCompilation(...)

Regression

This is a regression from Microsoft.NETCore.App.Crossgen2.win-x64 10.0.5 → 10.0.9 (and still present in main as of today).

10.0.5 accepts uppercase .DLL/.EXE inputs; 10.0.9 rejects them.

Root cause

In src/coreclr/tools/aot/crossgen2/Program.cs, RunSingleCompilation does a case-sensitive extension check:

string inputFileExtension = Path.GetExtension(inFilePath);
string nearOutFilePath = inputFileExtension switch
{
    ".dll" => Path.ChangeExtension(inFilePath,
        _singleFileCompilation && _inputBubble
            ? ".ni.dll.tmp"
            : ".ni.dll"),
    ".exe" => Path.ChangeExtension(inFilePath,
        _singleFileCompilation && _inputBubble
            ? ".ni.exe.tmp"
            : ".ni.exe"),
    _ => throw new CommandLineException(string.Format(SR.UnsupportedInputFileExtension, inputFileExtension))
};

Path.GetExtension preserves the casing of the actual file on disk. On a case-insensitive filesystem that returns uppercase names, the extension is .DLL/.EXE, which does not match .dll/.exe.

Proposed fix

Make the extension check case-insensitive, e.g.:

string nearOutFilePath = inputFileExtension.ToLowerInvariant() switch
{
    ".dll" => ...,
    ".exe" => ...,
    _ => throw ...
};

or compare with StringComparer.OrdinalIgnoreCase.

Environment

  • .NET SDK: 10.0.301
  • Runtime / crossgen2 package: Microsoft.NETCore.App.Crossgen2.win-x64 10.0.9
  • OS: Windows 11
  • Filesystem: WinFsp-backed virtiofs share with case-insensitive name normalization

Activity

  1. added
    untriaged
    on Aug 20, 2026
  2. added this to the 12.0.0 milestone on Aug 27, 2026
  3. removed
    untriaged
    on Aug 27, 2026
  4. added a commit that references this issue on Aug 28, 2026
    4b93db9
  5. locked and limited conversation to collaborators on Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

  • Status
    No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions