it is possible to get exception line number, when I publish webservice in release mode without pdb files?
1 Answers
Not without extensively modifying your code. Remember that the PDB
file has the necessary details to make your source code to the compiled output. Without out this, you will need to employ some sort of tracing to be able correlate the exception to the line number in your code. This can be achieved with techniques like specifying details in the exception message or using error codes.
The problem with these techniques and your goal is you will need to catch exceptions from code that isn't yours and wrap it in another exception. This is considered to be a poor practice as it is way too easy to swallow exceptions or incorrectly throw the wrapped exception causing you to loose your stack trace.
Take a look at the Stack Overflow article Release generating .pdb files, why? for more information on this matter.

- 1,774
- 12
- 19