etienne_marais
Honorary Master
- Joined
- Mar 16, 2008
- Messages
- 15,093
The ?. (null conditional / safe navigation) operator was added in C# 6.
We ran across a problem where a project using this operator did not compile in VS 2010 but did in VS 2015. The project was set as a .NET 2.0 project and it confused me why it should work in VS2015.
The reason turned out that this C# 6 feature is independent of the .NET framework, but dependent on the new Roslyn Compiler. There are however C# 6 features that ARE framework dependent and won't compile if you don't specify a .NET target version with a compatible CLR version.
We ran across a problem where a project using this operator did not compile in VS 2010 but did in VS 2015. The project was set as a .NET 2.0 project and it confused me why it should work in VS2015.
The reason turned out that this C# 6 feature is independent of the .NET framework, but dependent on the new Roslyn Compiler. There are however C# 6 features that ARE framework dependent and won't compile if you don't specify a .NET target version with a compatible CLR version.