什么是Environment.FailFast? [英] What is Environment.FailFast?

查看:359
本文介绍了什么是Environment.FailFast?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是Environment.FailFast?

What is Environment.FailFast?

如何为它有用吗?

推荐答案

它是用来杀一个应用程序,它的静态方法没有任何异常块被抓,将立刻杀死的应用程序。

It is used to kill an application, its a static method that will instantly kill an application without being caught by any exception blocks.

Environment.FastFail(字符串)可以
实际上是一个伟大的调试工具。
例如,假设你有一个
应用程序,只是彻头彻尾
给你一些奇怪的输出。你有
不知道为什么。你知道这是错的,但
刚好有没有例外冒泡
到表面来帮助你。那么,
如果你有机会到Visual Studio
2005年的调试 - >例外...菜单项,
你其实可以告诉Visual Studio中
让你看到那些第一次机会
异常。如果你没有那个,
但是你可以把
Environment.FastFail(字符串)在
例外,并使用演绎推理
和消除过程中,找出
,其中英寸

Environment.FastFail(String) can actually be a great debugging tool. For example, say you have an application that is just downright giving you some weird output. You have no idea why. You know it's wrong, but there are just no exceptions bubbling to the surface to help you out. Well, if you have access to Visual Studio 2005's Debug->Exceptions... menu item, you can actually tell Visual Studio to allow you to see those first chance exceptions. If you don't have that, however you can put Environment.FastFail(String) in an exception, and use deductive reasoning and process of elimination to find out where your problem in.

参考

这篇关于什么是Environment.FailFast?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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