简体   繁体   中英

System.Diagnostics.StackTrace compact framework

I'm trying to get the line number and file name of an exception when it is thrown for my app built on the .net Compact Framework. I know that StackTrace objects were left out of .netCF, but I wonder if there is an alternative. Searching google only brought up issues from back in 2005 or earlier, so I wonder if there has been any advancements made in the past 6 years.

Thanks!

The line number and file name are not available in the Compact Framework's stack trace in version 1.0, 2.0, or 3.5. Not sure about 3.7 (the underpinnings of Phone), but I doubt it's there either.

The StackTrace is only accessible from a thrown exception (and only from .NETCF 2.0 and later). Alternatively you can view the stacktrace on screen using the Debug.Fail dialog.

I believe if you find nothing else, just assume nothing new was done afterwards.

Anyway if you need to access the stack trace from a catch block you do have the exception object so it should be ok...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM