Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Null-conditional Operators Compatibility [duplicate]

Tags:

c#

.net

The Null-conditional Operators has supposedly been introduced in C# 6.0 (or .NET Framework 4.6). However, my project uses the 4.5.2 version of the framework (C# 5.0). While I'm using Visual Studio 2015, the IDE seems to understand the new notation and compiles/works properly. However, I'm confused about whether the project would still work upon publish. My development machine has 4.6 installed but the production server might not.

In other words, is the Null-conditional Operators really compatible with 4.5.2 or am I missing something?

like image 942
yazanpro Avatar asked Dec 25 '22 02:12

yazanpro


1 Answers

C# 6 works on the NET 4.5.1. You don't need .Net 4.6.

For more see Does C# 6.0 work for .NET 4.0?

like image 146
Suren Srapyan Avatar answered Jan 08 '23 17:01

Suren Srapyan