1

I need Visual Studio to throw first chance exceptions only for a specific class.

If i enable First Chance exception in Visual Studio, it enables for the entire solution.My solution is big and I do not want the exceptions to be thrown every where.

I want the exceptions to be thrown by Visual studio only for a specific piece of code/module/method.

How do I do that? Are there any attributes that I can use for this? Or is it possible to enable through code?

4

1 回答 1

1

正如你所说>

我的解决方案很大,我不希望到处都抛出异常。

我希望 Visual Studio 仅针对特定的代码/模块/方法抛出异常。

我建议您仅对希望 Visual Studio 抛出异常的代码段使用 try 和 catch 块。

如果解决方案很大,请尝试仅打开一次连接并在最后一点关闭它。

于 2013-03-11T04:51:12.177 回答