Skip to content

.Net Core 5.0 BinaryFormatter + Self-contained = FileNotFoundException(mscorlib, v4) #50760

@scegg

Description

@scegg

Description

Write a console app with BinaryFormatter called and compile that into self-contained, trimmode=link, publishtrimed, publishsinglefile . When run it under ubuntu arm64, an exception is thrown:
System.IO.FileNotFoundException: Could not load file or assembly 'mscorlib, Version=4.0.0.0

which is very similar with #34494 but this is related to net 5.

Test with self-contained without other flag passed w/o problem.

Configuration

.Net 5.0.201

BTW, I know that BinaryFormatter is obsoleted, lol.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-Serializationlinkable-frameworkIssues associated with delivering a linker friendly frameworkuntriagedNew issue has not been triaged by the area owner

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions