Friday, November 05, 2004

Creating distributable .pdb files

I found a useful .NET compile switch last night while studying through my latest in-depth .NET debugging tome that allows you to create safe debug information (.pdb) files ready for distribution with your .NET assemblies.

This is the switch used to create the .NET assemblies supplied by Microsoft. If you ever noticed that the stack trace is correct while using these assemblies but that the error 'No source code is available for the current location' is displayed when pausing, and if you want to replicate this behavior then read on.

The /PDBSTRIPPED compile switch generates a stripped pdb file that contains only the public functions and all-important FPO data (required for correct call stack information) without including the private information, such as variables, source code and line information.

A file named $(ProjectName)_STRIPPED.PDB is generated alongside the regular pdb file that, once renamed to (ProjectName).pdb, can safely be distributed to clients as part of your product.

0 Comments:

Post a Comment

<< Home