How to remove the full path to the project files .NET Core in the exceptions?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
21 views
There is a project .NET Core on the PC where it is developed it is in the directory, say /home/user/project/
When you publish the project and transfer it onto a working machine, if you have any exceptions in detail, you can see the full path of the project and line where the exception was thrown, for example /home/user/project/Program.cs:line 20

Tell me is it possible to hide such details, especially the full path, to remove all or leave only the file name.
by | 21 views

2 Answers

0 like 0 dislike
This information is stored in files with the extension *.pdb. They are needed for the debugger. To remove part of the path of them is impossible, but you can delete the entire file and then the exception will not be information about the source code, in General, will only call stack (class name, method name, etc.). It is also possible to .csproj to add a condition that when a release build, these files were not created:
\rnone\rfalse\r

Basically, these files are needed for debug. Without them, the debugger will not operate correctly, i.e. he will not be able to compare in the General case, the user manual with the source code. Appropriately not release to disable generation of these files is not necessary.
by
0 like 0 dislike
Publish the release configuration.
by

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
asked Jun 14, 2019 by VaniXac
0 like 0 dislike
1 answer
asked May 12, 2019 by Viktor_Ilukhin
0 like 0 dislike
3 answers
110,608 questions
257,186 answers
0 comments
35,406 users