Skip to content

pdb not found when running single exe that contains native dependencies #3807

Closed
@ztl8702

Description

@ztl8702

Steps to reproduce

I have a simple console app which has a dependency on Libgit2Sharp, which contains native binaries. When published as a single EXE, it fails to run.

git clone https://github.com/ztl8702/dotnet-core-single-exe-repro.git
cd dotnet-core-single-exe-repro/ConsoleAppUsingLibgit
dotnet publish -r win-x86 -c Release -o $env:HOME\bin-x86\ ConsoleAppUsingLibgit.csproj /p:PublishSingleFile=true /p:PublishTrimmed=true;
$env:HOME\bin-x86\ConsoleAppUsingLibgit.exe

Expected behavior

Console app runs, and should output something like:

Hello World! This app uses LibGit2Sharp
Latest commit: add tests to CI config

Actual behavior

Fails to run, with error:

Error:
  An assembly specified in the application dependencies manifest (ConsoleAppUsingLibgit.deps.json) was not found:
    package: 'LibGit2Sharp.NativeBinaries', version: '2.0.289'
    path: 'runtimes/win-x64/native/git2-7ce88e6.pdb'

I have set up CI on Github Actions to reproduce this.

See https://github.com/ztl8702/dotnet-core-single-exe-repro/runs/259587098 (and expand the logs for the "Test ..." steps)

Publishing without using single exe works fine.

Environment data

.NET Core SDK: 3.0.100
Operating system (reproducible when running the single exe on):

  • Windows 8 (32-bit)
  • Windows 10 1803 (64-bit)
  • Windows Server 2019 (Github Action runner)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-HostModelMicrosoft.NET.HostModel issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions