Answer the question
In order to leave comments, you need to log in
How to remove full path to .NET Core project files in exclusions?
There is a .NET Core project on a PC, where it is being developed, it lies in a directory, say /home/user/project/
When publishing a project and transferring it to a working machine, if exceptions occur in detail, you can see the full path to the project and the line where the exception was thrown out, for example /home/user/project/Program.cs:line 20
Tell me
if it is possible to hide such details, especially the full path, remove them altogether or leave only the file name.
Answer the question
In order to leave comments, you need to log in
This information is stored in *.pdb files. They are needed for the debugger. It is impossible to delete part of the path from them, but you can delete the entire file and then the exceptions will not contain information about the source code at all, there will be only a call stack (class name, method name, etc.). You can also add a condition to .csproj so that these files are not created during the release build:
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DebugType>none</DebugType>
<DebugSymbols>false</DebugSymbols>
</PropertyGroup>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question