I've been migrating quite a few projects to CoreCLR recently and the lack of ApplicationException is definitely problematic as a lot of existing code is using that type. Using just Exception doesn't sound quite right. Can we have it back in CoreFX?
Other exceptions I've seen no present in CoreFX that would also be useful are:
Thanks,
Manu
Why is AccessViolationException useful? Are you throwing instances of it? Catching instances of it? Something else?
Regarding ApplicationException we believe that creating that type was a mistake and are trying to move away from it. From MSDN:
You should derive custom exceptions from the Exception class rather than the ApplicationException class. You should not throw an ApplicationException exception in your code, and you should not catch an ApplicationException exception unless you intend to re-throw the original exception.
I think we are unlikely to add it back to .NET Core.
I fully understand the rationale for ApplicationException, but removing it is a hard way to make people migrate from it :-)
Some of the code I ported was catching AccessViolationException and this in the context of code that does a lot of interops.
Some of the code I ported was catching AccessViolationException and this in the context of code that does a lot of interops.
FWIW, this is fragile in general. Starting with .NET 4.0 you aren't able to catch AccessViolationException without opting into handling Corrupted State Exceptions.
Most helpful comment
Why is
AccessViolationExceptionuseful? Are you throwing instances of it? Catching instances of it? Something else?Regarding
ApplicationExceptionwe believe that creating that type was a mistake and are trying to move away from it. From MSDN:I think we are unlikely to add it back to .NET Core.