How do you publish a VS.NET app with the .PDB debug file included?

I have a Visual Studio C# .NET application that has an error logging routine implemented for unhandled exceptions.  This routine logs the line number that the exception occurred on, and it works fine in debug mode in the dev environment because the .PDB file is present.  However, I want to publish a release of my Visual Studio .NET application and still be able to get the line number that unhandled exceptions occurred on without having to deal with any manual downloading of the latest .PDB file or anything that complicated.

I thought this would be a simple setting in the project options, but I have been unable to find anything that works, nor have I been able to find any solutions on Google.  
DigitechComputerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SriVaddadiCommented:
Set the build in debug mode and try publishing from Build menu of VS ide. This would include PDB file as well.
0
DigitechComputerAuthor Commented:
I have tried publishing in both Debug and Release mode.  In both cases, the PDB file does not get distributed to users who run it and install the updated build.
0
SriVaddadiCommented:
How are you publishing? Could you elaborate on it?
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

DigitechComputerAuthor Commented:
I am using Visual Studio's built in publishing feature.  The application properties are configured for a location to publish to, files to include, etc.  To publish, I go to Build -> Publish "application name", and hit Finish.  

I have tried various settings in the application properties to try and get the PDB files to be included in the publish, but nothing has worked so far.  For example, under the application properties' Build tab, I click Advanced, and under Debug Info the drop down is set to "full", but line numbers are still not being logged.  

By the way, I am finding the line number by creating a StackTrace object from the exception that is thrown, then calling stackTrace.GetFrame(0).GetFileLineNumber().  As I said, this works fine when running in debug mode from Visual Studio, but in the build it always returns 0.  If I manually copy all of the PDB files that are in the project's .../bin/Debug directory, the published build will log the line number just fine.
0
SriVaddadiCommented:
1. Open Project properties
2. Goto Publish tab
3. Click "Application Files..." button
4. Show all files
5. Set the publish status of the pdb file to include(auto) and set other properties
6. Re-publish
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DigitechComputerAuthor Commented:
I knew it would end up being something simple.  I looked in there before to see if I could include the .pdb's, but never noticed the "Show all files" checkbox.  Thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.