[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

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

Posted on 2010-04-08
6
Medium Priority
?
542 Views
Last Modified: 2013-12-17
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.  
0
Comment
Question by:DigitechComputer
  • 3
  • 3
6 Comments
 
LVL 16

Expert Comment

by:SriVaddadi
ID: 30151756
Set the build in debug mode and try publishing from Build menu of VS ide. This would include PDB file as well.
0
 

Author Comment

by:DigitechComputer
ID: 30202286
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
 
LVL 16

Expert Comment

by:SriVaddadi
ID: 30211625
How are you publishing? Could you elaborate on it?
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 

Author Comment

by:DigitechComputer
ID: 30213287
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
 
LVL 16

Accepted Solution

by:
SriVaddadi earned 1000 total points
ID: 30213632
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
 

Author Comment

by:DigitechComputer
ID: 30214182
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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
Suggested Courses

591 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question