Andrus
Andrus

Reputation: 27931

How to show line numbers in stack trace if single file is produced

ASP.NET 5 MVC application uses single file publishing method for deployment:

enter image description here

In this case stack trace does not contain line numbers. If

[v]Produce single file

Checkbox is unchecked, line numbers are shown. How to enable line numbers if single file is published ?

I tried to set Debug information Full to in Advanced build setting

enter image description here

and

changed project file as described in Show line number in exception handling to

<DebugSymbols>true</DebugSymbols>
<DebugType>embedded</DebugType>

but line numbers are still not shown if published to single file. Visual Studio 2019 IDE is used to publish.

Upvotes: 2

Views: 502

Answers (1)

HaroldMorgan
HaroldMorgan

Reputation: 174

Unfortunately this seems like a known bug and it's not closed even in recent (net6.0 as I'm writing it) .net versions. Our team is suffering from this issue too.

Although making the single file publication with .pdb files attached helps, it's writing something like:

<DebugType>embedded</DebugType> 

in your csproj file, more on that here.

But it's not clear if it's should be a default behaviour

Upvotes: 2

Related Questions