c# - windows 10 exceptions not including line numbers -


i have windows 10 universal app not include line numbers in exception objects .tostring() method.

if have method like

private void throwexception() {     try { throw new exception("test"); }     catch (exception e) { debug.writeline(ex.tostring()); } } 

when check output, don't see line number there exception thrown. added post build event project:

xcopy $(projectdir)$(outdir)*.pdb $(projectdir)$(outdir)appx\*.pdb 

the pdb file in debug folder not in appx folder.

what missing? thanx,

edit

i created new project test this. have single page (mainpage.xaml). here code behind file:

using system; using windows.ui.popups; using windows.ui.xaml.controls; using windows.ui.xaml.navigation;  namespace app2 {     public sealed partial class mainpage : page     {         public mainpage()         {             initializecomponent();         }          protected override void onnavigatedto(navigationeventargs e)         {             base.onnavigatedto(e);             throwexception();         }          private async void throwexception()         {             try { throw new exception("test"); }             catch (exception ex) { await new messagedialog(ex.tostring()).showasync(); }         }     } } 

as before, added post build event macro:

xcopy $(projectdir)$(outdir)*.pdb $(projectdir)$(outdir)appx\*.pdb 

i compiled in release configuration , insured "compile .net native tool chain" option checked.

the appx folder in c:\vs2015\app2\app2\bin\x86\release\appx have files app2.dll , app2.pdb present.

when run app, following in popup dialog:

system.exception: test   @ sharedlibrary!<baseaddress>+0x122d16 

thanx

edit 2

i tried in debug without native tool chain. in case, did not see pdb file in appx folder under debug

the message in case was:

system.exception: test   @ app2.mainpage.<throwexception>d_2.movenext() 

thanx

i made error in original answer , using immediate window output , not code exception object.

after more research, looks no longer supported.

see corefx #1420 , related corefx #1797.

also, there reference on so: how stacktrace without exception in windows universal 10 app


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -