Using C# 6 Language Features In Your Software Tomorrow

Visual Studio 2015 dropped today, along with C# 6, and a whole host of new language features. While many new features of .NET are tied to framework and library upgrades, language features are specifically tied to compiler upgrades, rather than runtime upgrades.

What this means, is that so long as the build environment for your application supports C# 6, it can produce binaries that can run on earlier versions of the .NET framework, that make use of new language features. The good news for most developers is that this means that you can use these language features in your existing apps today Ė you donít have to wait to roll out framework upgrades across your production servers.

Youíll need to install the latest version of Visual Studio 2015 on your dev machines, and youíll need to make sure your build server has the latest Build Tools 2015 pack installed to be able to compile code that uses C#6.

You can grab the Build Tools 2015 pack from Microsoft here: https://go.microsoft.com/fwlink/?LinkId=615458

Iíve verified C#6 apps, compiled under VS2015, at the very least run on machines that run .NET4.5.
If youíre doing automated deployment with Kudu to Azure, you may need to wait until they roll out the tools pack to the Web Apps infrastructure.

Have fun!

Leave a Reply