Skip to content

Support embedded PDB #1857

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
SIkebe opened this issue Dec 7, 2020 · 3 comments
Closed

Support embedded PDB #1857

SIkebe opened this issue Dec 7, 2020 · 3 comments

Comments

@SIkebe
Copy link

SIkebe commented Dec 7, 2020

In .NET Core 3.X, there is a workaround for single file exe with libgit2sharp.

However, in .NET 5.0, there is no support for IncludeSymbolsInSingleFile and Microsoft recommends embedded PDBs instead.
dotnet/runtime#42278 (comment)

Could you consider using embedded PDB?

mkdir Sample && cd Sample
dotnet new console
dotnet add package libgit2sharp

# Modify csproj file (See below)

dotnet publish -c Release -r win-x64 --self-contained=true /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true
using System;

namespace Sample
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
        }
    }
}

Sample.csproj

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net5.0</TargetFramework>
    <DebugType>embedded</DebugType>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="libgit2sharp" Version="0.26.2" />
  </ItemGroup>

</Project>

image

@CyberSinh
Copy link

I don't know what workaround could be used, but it would be more useful to deal with this problem at the root and stop making a PDB file mandatory to start an application. A ticket (libgit2/libgit2sharp.nativebinaries#111) has been posted for this purpose but no answer so far.

@bording
Copy link
Member

bording commented Aug 13, 2021

This has been fixed with 0.27.0-preview-0116.

@bording bording closed this as completed Aug 13, 2021
@SIkebe
Copy link
Author

SIkebe commented Aug 13, 2021

I've confirmed this issue solved. Thanks!

Viir added a commit to pine-vm/pine that referenced this issue Aug 16, 2021
…tch to newer .NET versions

For discussion of the errors we got with earlier versions, see libgit2/libgit2sharp#1857 and libgit2/libgit2sharp.nativebinaries#111
Viir added a commit to pine-vm/pine that referenced this issue Aug 16, 2021
For discussion of the errors we got when trying .NET 5 with earlier versions of libgit2sharp, see libgit2/libgit2sharp#1857 and libgit2/libgit2sharp.nativebinaries#111
Viir added a commit to pine-vm/pine that referenced this issue Aug 16, 2021
The single-file build functionality in .NET 5 did not work well with earlier versions of libgit2sharp. Let's see if our build works with this version and .NET 5 or .NET 6.
For discussion of the errors we got when trying .NET 5 with earlier versions of libgit2sharp, see libgit2/libgit2sharp#1857 and libgit2/libgit2sharp.nativebinaries#111
Viir added a commit to pine-vm/pine that referenced this issue Aug 16, 2021
The single-file build functionality in .NET 5 did not work well with earlier versions of libgit2sharp. Let's see if our build works with this version and .NET 5 or .NET 6.
For discussion of the errors we got when trying .NET 5 with earlier versions of libgit2sharp, see libgit2/libgit2sharp#1857, libgit2/libgit2sharp.nativebinaries#111, dotnet/sdk#3685, and dotnet/runtime#36590
Viir added a commit to pine-vm/pine that referenced this issue Aug 16, 2021
The single-file build functionality in .NET 5 did not work well with earlier versions of libgit2sharp. Let's see if our build works with this version and .NET 5 or .NET 6.
For discussion of the errors we got when trying .NET 5 with earlier versions of libgit2sharp, see libgit2/libgit2sharp#1857, libgit2/libgit2sharp.nativebinaries#111,
libgit2/libgit2sharp.nativebinaries#119, dotnet/sdk#3685, and dotnet/runtime#36590
Viir added a commit to pine-vm/pine that referenced this issue Aug 16, 2021
The single-file build functionality in .NET 5 did not work well with earlier versions of libgit2sharp. Let's see if our build works with this version and .NET 5 or .NET 6.
For discussion of the errors we got when trying .NET 5 with earlier versions of libgit2sharp, see libgit2/libgit2sharp#1857, libgit2/libgit2sharp.nativebinaries#111,
libgit2/libgit2sharp.nativebinaries#119, dotnet/sdk#3685, and dotnet/runtime#36590
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants