Skip to content
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

Difference between IncludeSymbolsInSingleFile and DebugType embedded? #42278

Closed
holc-tkomp opened this issue Sep 15, 2020 · 10 comments
Closed

Difference between IncludeSymbolsInSingleFile and DebugType embedded? #42278

holc-tkomp opened this issue Sep 15, 2020 · 10 comments
Labels
area-Single-File question Answer questions and provide assistance, not an issue with source code or documentation.
Milestone

Comments

@holc-tkomp
Copy link

What's the difference between adding

<IncludeSymbolsInSingleFile>true</IncludeSymbolsInSingleFile>

and

<DebugType>embedded</DebugType>

to your .csproj?

This is pretty straightforward question, but I really couldn't find anything more than "IncludeSymbolsInSingleFile" is only available for .NET Core 3.0+ in design.md (which is kind of obvious, as you have to be able to build single-file).

So, is there any difference? Especially in how they get embedded?

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-System.IO untriaged New issue has not been triaged by the area owner labels Sep 15, 2020
@ghost
Copy link

ghost commented Sep 15, 2020

Tagging subscribers to this area: @agocke
See info in area-owners.md if you want to be subscribed.

@agocke
Copy link
Member

agocke commented Sep 15, 2020

In 3.0, symbols could be included by embedding the PDBs in the bundle, and at runtime they would be extracted to a temporary directory next to the app DLLs. In 5.0, we removed support for bundling and extracting the PDBs and recommend using embedded PDBs instead, where the PDB information is directly embedded inside each assembly (there are no separate PDB files). In general, embedded PDBs are better. It's a long supported feature and is usually understandable by most debuggers.

@agocke agocke added question Answer questions and provide assistance, not an issue with source code or documentation. and removed untriaged New issue has not been triaged by the area owner labels Sep 15, 2020
@agocke agocke added this to the Future milestone Sep 15, 2020
@holc-tkomp
Copy link
Author

Thanks for your reply, I managed to think of some additional questions in the meantime:

  1. How does IncludeSymbolsInSingleFile work in .NET 5 then?
  2. How can one extract/inspect the "non-extracting" .NET 5 bundle?
  3. Could you point me into some sources that could help me better understand what sits inside such .NET 5 bundle and how to potentially read it?
  4. Can .NET 5 potentially generate self-extracting bundle? How to achieve this?

@agocke
Copy link
Member

agocke commented Sep 16, 2020

How does IncludeSymbolsInSingleFile work in .NET 5 then?

It doesn't. It's not supported.

How can one extract/inspect the "non-extracting" .NET 5 bundle?

It's currently not supported to examine the bundle, it's basically an opaque exe.

Can .NET 5 potentially generate self-extracting bundle? How to achieve this?

Setting the property IncludeContentForSelfExtract to true will go back to the .NET Core 3.1 behavior instead of using the new bundling.

@holc-tkomp
Copy link
Author

holc-tkomp commented Sep 16, 2020

How does IncludeSymbolsInSingleFile work in .NET 5 then?

It doesn't. It's not supported.

Ah, just updated to RC1, it was still supported working in Preview 8, with results below, and thus the question.

Results in Preview 8

Using simple WPF app, referencing Microsoft.Data.SqlClient, using single-file, framework-dependent, win-x86 publish, without IncludeSymbolsInSingleFile (or set to false), I was getting the following files as a publish output:

no include

After setting IncludeSymbolsInSingleFile to true, I was getting the following:

IncludeSymbolsInSingleFile

How can one extract/inspect the "non-extracting" .NET 5 bundle?

It's currently not supported to examine the bundle, it's basically an opaque exe.

😢

Can .NET 5 potentially generate self-extracting bundle? How to achieve this?

Setting the property IncludeContentForSelfExtract to true will go back to the .NET Core 3.1 behavior instead of using the new bundling.

That either works different than expected, or doesn't work at all. I expected it to extract itself in %temp%\.net\, but I was not able to found extracted executable anywhere (used Everything to search for WpfApp1.exe - nothing that could be considered extraction folder). Should I create issue for this?

@agocke
Copy link
Member

agocke commented Sep 16, 2020

Sorry, I think I typo'd that: should be IncludeAllContentForSelfExtract. Can you try that instead?

@holc-tkomp
Copy link
Author

With IncludeAllContentForSelfExtract folder in %temp%\.net\ is generated, although it only seems to contain native dependencies - in this case, just one file: Microsoft.Data.SqlClient.SNI.dll. No WpfApp1.dll, .deps.json, .runtimeconfig.json like in raw .NET Core 3.1.

@agocke
Copy link
Member

agocke commented Sep 16, 2020

@holc-tkomp You're right! That looks like a bug to me.

@agocke
Copy link
Member

agocke commented Sep 16, 2020

Filed #42352 for this issue

@vitek-karas
Copy link
Member

Sorry for the late response...

In 5.0.0 the IncludeAllContentForSelfExtract should behave basically identical to 3.1 bundles - all files should be extracted to disk and executed from the disk.

As for the bundle format:

Design doc

Implementation of the bundling

Writing a tool to extract all of the content from the bundle should be pretty simple (the format is rather primitive).

@ghost ghost locked as resolved and limited conversation to collaborators Dec 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Single-File question Answer questions and provide assistance, not an issue with source code or documentation.
Projects
None yet
Development

No branches or pull requests

5 participants