C# 6.0 Features in Visual studio 2012 (Professional Edition)

This article is responding question whether you can use C# 6.0 Features in Visual studio 2012 or not ?

Answer is Yes. You can use.

I tried Auto-Property Initializer (a feature of C# 6.0). Here it works.

You need to install latest .net compilers package using package manager console.

Go to quick launch in  visual studio 2012,  Search for package manager console. This will launch package manager console.

Command to install latest .net compiler is

“Install-Package Microsoft.Net.Compilers”

Create a property inside class.

Build the project. Don’t get annoyed by seeing the error list

But the build succeed.  Application runs successfully. Why you will see this error is ?

It is the VS2012 editor that doesn’t understand the new syntax and shows errors,

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s