Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do not show file paths of build machine in stack trace [duplicate]

Tags:

I am currently developing a C# application which has got it's own logging. When exceptions are thrown, the exception is saved into a list which can be viewed by the user via a list view. When the user clicks on a exception in the list view, the stack trace of the exception is shown in a text box. But even when I am executing the program on a remote machine, the stack trace shows the file paths to the original source files from the machine where the application was compiled.

e.g.:

at C:\Folder1\Folder2\Class1.cs:81 at C:\Folder1\Folder2\Class2.cs:65 at C:\Folder1\Folder1\Class3.cs:21 

Only displaying the source files without folders would be nice...

How can I change this behaviour?

Is there any native solution? Or do I have to simply do some string manipulation?

like image 584
Emiswelt Avatar asked Jan 26 '10 12:01

Emiswelt


People also ask

How do I disable stack trace?

If you wish to disable this feature, simply append /? showtrace=0 to the URL, and the stack trace should disappear after reloading your browser.

What is a stack trace and how can I use it to debug my application errors?

In addition to telling you the exact line or function that caused a problem, a stack trace also tracks important metrics that monitor the health of your application. For example, if the average number of stack traces found in your logs increases, you know a bug has likely occurred.

What is a stack trace and what is it useful for?

A stack trace is a report that provides information about program subroutines. It is commonly used for certain kinds of debugging, where a stack trace can help software engineers figure out where a problem lies or how various subroutines work together during execution.


1 Answers

You probably have the .pdb files with the installed app. Without the .pdb files, it should not show the file locations.

Have a look at Getting line numbers in exception stack trace in a Windows Service

and include line numbers in stack trace without pdb?

You can't get a stack trace with line numbers directly from your application unless you bundle the PDB.

like image 57
Adriaan Stander Avatar answered Oct 11 '22 15:10

Adriaan Stander