2

How can i deploy an .NET exe but still utilize the pdb file in another location? I am worried keeping it with the exe in the same location could cause end users to accidentally delete the pdb. We would like however, to see the error details (e.g. module, line number) when an error is encountered by the user. If there is another way of getting this information without the .pdb, please let me know. Thanks in advance!

leppie
  • 115,091
  • 17
  • 196
  • 297
Kathryn
  • 21
  • 1

2 Answers2

2

You can do it by setting environment variable _NT_SYMBOL_PATH on startup of your application. When searching for debugging symbols, path at this environment variable (if any) will be inspected for .pdb files. Put your symbols in some folder (let's say that is "%localappdata%\MyApp\Symbols"), then do:

var symbolsPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "MyApp", "Symbols");
Environment.SetEnvironmentVariable("_NT_SYMBOL_PATH", symbolsPath);
Evk
  • 98,527
  • 8
  • 141
  • 191
0

This answer describes a way to get that information without the pdb with a bit of build time preparation.

I would suggest though that the users don't get to have Delete rights to the folder where you install your application (e.g: Program Files?) If they do, or if they are administrators, nothing stops them from deleting pdb's or exe's for that matter.

Community
  • 1
  • 1
Bruno Garcia
  • 6,029
  • 3
  • 25
  • 38
  • unfortunately they have read/write access and that wont be able to change. i know the files can be brought back from a secure copy but we would like to not even have the .pdb visible to the end users if possible in order to avoid confusion. – Kathryn Apr 12 '16 at 20:21