9
|
Joseph Daigle Sarabpreet Singh Anand · 技术社区 · 15 年前 |
![]() |
1
12
StackTrace属性是虚拟的-创建您自己的派生异常类,并让该属性返回您想要的任何内容。 |
![]() |
2
3
乱搞堆栈跟踪听起来真的不是一个好主意,即使这是可能的(我对此表示怀疑)。告诉我,你为什么要这么做?NET框架本身(BCL)通常使用静态实用程序方法抛出异常,正如您所建议的那样(
下面是我刚刚运行的测试中的堆栈跟踪示例: at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) at System.ThrowHelper.ThrowArgumentOutOfRangeException() at System.Collections.Generic.List`1.get_Item(Int32 index) at HelloWorld.Program.Main(String[] args) in C:\...\Program.cs:line 23 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()
|
![]() |
John V · 是否存在单元测试无法发现的逻辑/流错误类型? 6 年前 |
![]() |
Beefster · 为什么ANSI颜色转义以“m”而不是“]”结尾? 7 年前 |
![]() |
Guillermo Gutiérrez · STR转换是如何工作的? 7 年前 |
![]() |
RudziankoÅ · 合并排序数组算法 7 年前 |
|
user8852560 · 构造函数中的验证和构造函数冲突 7 年前 |
![]() |
jav974 · 订购产品时寻找最佳价格组合的算法 7 年前 |
![]() |
hippietrail · 确定浮点数中前导零的数量 7 年前 |