Skip to content

PEVerify fails compiling entrypoint in metadata-only mode #76707

@jjonescz

Description

@jjonescz

Version Used: 9881daa

Steps to Reproduce:

[Fact]
public void EmitMetadataOnly_TopLevelStatements()
{
    CompileAndVerify("""
        System.Console.WriteLine("a");
        """,
        emitOptions: EmitOptions.Default.WithEmitMetadataOnly(true))
        .VerifyDiagnostics();
}

Expected Behavior: Succeeds.

Actual Behavior: PEVerify fails with "Bad token as entry point in CLR header."

Note that using Main and TestOptions.ReleaseExe fails in the same way.

Perhaps it's expected that ref assemblies are only supported by PEVerify for class libraries, not console apps.

Metadata

Metadata

Assignees

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions