GetExternalTasksSystem.NullReferenceException

Can any one tell me why this exception is thrown?

GetExternalTasksSystem.NullReferenceException: Object reference not set to an instance of an object.

To fully understand why a NullReferenceException is thrown, it is important to know the difference between value types and reference types.

So, if you’re dealing with value types, NullReferenceExceptions can not occur. Though you need to keep alert when dealing with reference types!

Only reference types, as the name is suggesting, can hold references or point literally to nothing (or ‘null’). Whereas value types always contain a value.

Reference types (these ones must be checked):

  • dynamic
  • object
  • string

Value types (you can simply ignore these ones):

  • Numeric types
  • Integral types
  • Floating-point types
  • decimal
  • bool
  • User defined structs