Skip to content

Reading entry assembly in AppHost / SingleFileHost #519

@caesay

Description

@caesay

Problem Description

Epic library!

When given a random EXE file, it's currently cumbersome to locate the dotnet entry assembly.

  • For Full Framework Exe's, you can use AssemblyDefinition.FromFile.
  • For dotnet SingleFileHost (PublishSingleFile), you need to use BundleManifest.FromFile, and then kind of guess what the entry dll is from the file name of the BundleFileType.RuntimeConfigJson entry
  • For reading dotnet AppHost, this seems to be entirely unsupported. We would need to read the placeholder to get the relative path to the entry dll. I can see there is support for writing the placeholder, but not reading one.

Proposal

Ideally, there would be an API to read the placeholder / relative entry dll path, so given an EXE we could locate the entry dotnet assembly.

Furthermore, if there was an API which could "detect" the entry assembly given an arbitrary EXE, that would also be neat - but some documentation describing how to do this yourself would also be good as an alternative.

Alternatives

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    dotnetIssues related to AsmResolver.DotNetenhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions