I've analysed 2500 bug reports. There are 125 (5%) bugs with a NullReferenceException (or similar exceptions in other languages, such as AccessViolation in Delphi and 'filter is undefined' in Javascript).
These bugs are easy to solve while debugging, but it is hard to localize this exception in runtime scenarios because the only message we get from users is 'Object reference not set to an instance of an object'.
The debugger in Visual Studio 2022 is giving more detailed information such as 'filter was null'.
Is there a way to add get this information in runtime? And is there a way to enrich or override the 'Object reference...' message in such a way that I can include more details, such as the TargetSite Name and assembly?
