C#异常不给行号 [英] C# Exceptions Not Giving Line Numbers

查看:615
本文介绍了C#异常不给行号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用有来自一个Java背景的C# - 我有一个例外,但它并没有告诉我行号 - 只要方法名

I am using C# having come from a Java background - I have an exception but it does not tell me the line number - Just the method name.

是平常?它是下降到调试/发布版本??

Is that usual?? Is it down to Debug / Release builds??

推荐答案

行号应在调试编译时,可只要你保持 PDB 文件中的应用目录。

Line numbers should be available when compiling in Debug as long as you keep the pdb files in the application directory.

这也将在发行工作,如果你能创造PDB,按<一个href=\"http://stackoverflow.com/questions/2191957/c-exceptions-not-giving-line-numbers/2191986#2191986\">Justin's回答。

This will also work in Release if you enable PDB creation, as per Justin's answer.

如果您有兴趣,更多信息可以在 PDB文件发现(MSDN)

If you are interested, more information can be found at PDB Files (MSDN)

这篇关于C#异常不给行号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆