File paths in PDB files

This forum is meant for questions and discussions about the X# language and tools
Post Reply
leon-ts
Posts: 435
Joined: Fri Feb 03, 2017 1:43 pm

File paths in PDB files

Post by leon-ts »

Hi all,

Is there any setting that can be used to specify that only the relative path to the source code files is saved in the output PDB file? By default, the PDB file stores the full path to the source files on the build machine.

This can be inconvenient for several reasons if this build is production and is intended to be run on the client. For example, the path can be very long and the potential error message can be unwieldy. Also, the path of placing projects can to some extent be attributed to confidential information and I would not want to show it to third parties.

Maybe someone knows if there is such a possibility (an option for generating a PDB) and if so, how to enable it?

Best regards,
Leonid
Best regards,
Leonid
User avatar
robert
Posts: 4529
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

File paths in PDB files

Post by robert »

Leonid,
I have not used it, but you should look at the pathmap commandline argument:
See https://docs.microsoft.com/en-us/dotnet ... ler-option
and
https://www.xsharp.eu/help/opt-pathmap.html

You cannot set this property through our UI but you should be able to add a <pathmap></pathmap> entry to the VS project properties to automatically add this to the compiler command line. Of course you can also use the entry on the build page to specify additional commandline options.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
leon-ts
Posts: 435
Joined: Fri Feb 03, 2017 1:43 pm

File paths in PDB files

Post by leon-ts »

Robert,

It works and is exactly what I need!

Code: Select all

<pathmap></pathmap>
Many many thanks!

P.S. I couldn't do it through the additional command line options on the Build page. Throws an error: The pathmap option was incorrectly formatted. I entered in the input field:

Code: Select all

-pathmap:D:ProjectsVisual Studio 2019TestConsoleApplicationTestConsoleApplication=TestConsoleApplication
But it is enough for me that it works through xsproj.

Best regards,
Leonid
Best regards,
Leonid
User avatar
robert
Posts: 4529
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

File paths in PDB files

Post by robert »

Leonid
Another example that proves that it was a good idea to build our compiler on top of Roslyn

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Post Reply