优点& .NET应用程序中的异常处理的缺点? [英] Pros & cons of Exception Handling in .NET Applications?

查看:66
本文介绍了优点& .NET应用程序中的异常处理的缺点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿!!!

我希望异常处理方法(根据微软的指南和最佳实践提出)不会因任何域名或任何域名的规定而产生任何偏差(或影响)或因为客户的要求。



话虽如此,任何人都可以帮我证明是否在所有方法中都能找到主要的异常(在这种情况下是单一的)使用的catch块是否是正确的方法。根据我的理解,我们应该捕获特定的异常但不是全部(在这种情况下使用多个catch块)。但是,如果我们不遵循这一点,它是否会对性能或任何其他领域产生任何影响?所以请详细解释,因为我可以根据项目目的做出相应的决定。



谢谢。

Hey!!!
I hope that Exception Handling approach (as proposed by Microsoft''s Guidelines & Best Practises) will not have any deviations (or impact) according to any domain specfic or because of client requirements.

Having said that could anybody help me to justify whether catching main Exception everywhere in all methods (in this case single catch block used) is a correct approach or not. As per my understanding we should catch specific exceptions but not all (in this case multiple catch blocks used). But if we dont follow this whether it may have any impact on Performance or any other area? So please explain in detail as I could take decision accordingly for our Project purpose.

Thanks.

推荐答案

这是一篇关于这个主题的好文章:

.NET中的异常处理最佳实践 [ ^ ]



祝您好运!
This is a great article on this subject:
Exception Handling Best Practices in .NET[^]

Good luck!


以下论坛讨论可能会对您有所帮助。< br $> b $ b

MSDN论坛讨论 [ ^ ]
The below forum discussion might help you.

MSDN Forum Discussion[^]


这篇关于优点&amp; .NET应用程序中的异常处理的缺点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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