Get tips to solve null reference exception

What is NullReferenceException? Object reference not set to an instance of an object

Matt Watson Developer Tips, Tricks & Resources Leave a Comment

Null reference errors are responsible for a good percentage of all application bugs. They are usually very simple problems caused by not adding additional logic to ensure that objects have valid values before using them.  Here are some ways to avoid NullReferenceException. The following code will throw a NullReferenceException if the variable “text” being passed in is null. You can’t call …

What is an Unhandled Exception, and How to Catch All C# Exceptions

Matt Watson Developer Tips, Tricks & Resources Leave a Comment

What is an Unhandled Exception? An exception is a known type of error. An unhandled exception occurs when the application code does not properly handle exceptions. For example, When you try to open a file on disk, it is a common problem for the file to not exist. The .NET Framework will then throw a FileNotFoundException. This is a simple example …