when I have following code:
public class Entry
{
public void Main()
{
var p = new Class1();
}
}
public class Class1
{
public Class1()
{
DoSomething();
}
private void DoSomething()
{
try
{
CallToMethodWhichThrowsAnyException()
}
catch (Exception ex)
{
throw new CustomException(ex.Message); // where CustomException is simple System.Exception inherited class
}
}
}
Why does my CustomException not get thrown and stop the execution for debugging in Entry.Main or in the constructor of Class1 (or in my DoSomething method)?
There is only the message A first chance exception of type 'MyLibrary.CustomException' occurred in MyLibrary.dll
in the immediate window.
Exception settings for Visual Studio are set that all CLR Exceptions are only thrown when User-unhandled.