I am developing a .NET 4.5 project, which will run on Windows 7 machines; however I am developing it on the Windows 10 machine.
What I am having problem with is the fact, that null checking operator ?.
has only been introduced with .NET 4.6 (as far as I know).
Even though my project is targetting .NET 4.5, I can still use ?.
operator in my code, and VS returns no error.
Here is an example of what I mean:
Pre ?. operator code:
var sAdditionalNode = xNodes.Current.SelectSingleNode("Details/SomeDetails", xNameSpace);
if (sAdditionalNode!=null)
{
var sAdditionalDetails = sAdditionalNode.Value;
}
After ?. operator has been implemented
var sAdditionalDetails = xNodes.Current.SelectSingleNode("Details/SomeDetails", xNameSpace)?.Value;
Am I correct when I believe, that even though currently I have no problem using ?.
operator in my code; once I deploy my project under the Windows 7 (with .NET 4.5), I will suddenly start having problems?