bitbonk,
@bitbonk@mastodon.social avatar

With the help of @slang25 I learned some interesting stuff today.

🧵↓

bitbonk,
@bitbonk@mastodon.social avatar

@slang25 <DebugType>embedded</DebugType> allows you to embed the PDBs directly into the assembly. No more symbol server or snupkg needed.

And because it is based on the new portable PDB format the assembly does not get much bigger (word on the streets is that the assembly gets 30% bigger).

https://learn.microsoft.com/dotnet/csharp/language-reference/compiler-options/code-generation#debugtype

bitbonk,
@bitbonk@mastodon.social avatar

@slang25 <EmbedAllSources>true</EmbedAllSources> additionally lets you embed the source code into the portable PDB. No more Source Link needed.

This only works with <DebugType>embedded</DebugType> or<DebugType>portable</DebugType> because those are the only flags that will generate portable PDBs (AFAIK).

bitbonk,
@bitbonk@mastodon.social avatar

@slang25 But even if you have an assembly without any symbols, ever since .NET 6 you can make the runtime spit out a method metadata token and IL offset in a stack trace using System.Diagnostics.StackTrace.ShowILOffsets.

Unfortunately there isn't currently an IDE that can make use of that.

https://github.com/dotnet/runtime/pull/44013

bitbonk,
@bitbonk@mastodon.social avatar

@slang25 Additionally, I did not know that there is a predefined msbuild variable that can tell me if a project is a test project: IsTestProject

https://github.com/justeattakeaway/JustSaying/blob/main/Directory.Build.props#L53

KirillOsenkov,
@KirillOsenkov@mastodon.social avatar

@bitbonk @slang25 15% on average

  • All
  • Subscribed
  • Moderated
  • Favorites
  • dotnet
  • ngwrru68w68
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • InstantRegret
  • GTA5RPClips
  • Youngstown
  • everett
  • slotface
  • rosin
  • osvaldo12
  • mdbf
  • kavyap
  • cubers
  • megavids
  • modclub
  • normalnudes
  • tester
  • khanakhh
  • Durango
  • ethstaker
  • tacticalgear
  • Leos
  • provamag3
  • anitta
  • cisconetworking
  • JUstTest
  • lostlight
  • All magazines