Do not get exception line number in dot net app

I have a data transfer application that fits into .Net 3.0 VS2008.

I deployed in debug mode and copied the PDB file to the server that I want to run.

I get an exception, but not a line number.

This is how I show the exception

Why is there no exception line number ???

Malcolm

       string msg = string.Format("{0} {1} {2}",ex.Message,ex.StackTrace.ToString(),ex.Source.ToString());               
        if(ex.InnerException != null)
            msg += string.Format(" {0}", ex.InnerException.ToString());
        return msg;
+3
source share
2 answers

If you do not get line numbers, then

a) . .NET runtime determines that .pdb does not match the assembly (deprecated, compiled with optimizations, etc.).

or

b) Build from a directory other than the one containing .pdb (for example, the Windows service is running% WINDOWS% \ System32)

, , Windows ?

AppDomain.CurrentDomain.BaseDirectory , .pdb( , , )

+9

... , ex.toString() , ,

, pdb . , ex.toString(), .

+1

Source: https://habr.com/ru/post/1707594/


All Articles