I believe that pathLookUpLocation is of type RegistryKey .
The reason for this message is that your code will throw a NullReferenceException if the value with the key specified by RegLookupKey not found. This happens because you pass null as the second parameter to GetValue . The second parameter is the default value, which is returned if the key is not found.
Correct it by changing it to string.Empty :
this.Path = pathLookUpLocation.GetValue(RegLookupKey, string.Empty).ToString();
source share