Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using statement with static class is not working in visual studio 2015 CTP

I have written a following code for one of my C# 6.0 Sample application. It was working fine earlier with Visual Studio 2015 Preview. But now when I have downloaded the newest version of Visual Studio 2015 which launched before some time.(http://blogs.msdn.com/b/bharry/archive/2015/01/16/visual-studio-2015-ctp-5-is-available.aspx) it stopped working.

Following is a code for that.

using System.Console;

namespace StaticClassUsing
{
     class Program
     {
        static void Main(string[] args)
        {
              WriteLine("With using statement");
        }
     }
 }

Now when you run this application in Latest Version of Visual Studio 2015 its giving error like following.

enter image description here

I have tried setting up language to C# 6.0. Is Microsoft is moving away with this feature?

Any help will be appreciated.

like image 272
Jalpesh Vadgama Avatar asked Jan 24 '15 07:01

Jalpesh Vadgama


1 Answers

This was recently changed from the syntax:

using System.Console;

to

using static System.Console;

See https://github.com/dotnet/roslyn/commit/b49f841bdeeb0b620240d2435f5a0665012f6fce

like image 193
Federico Berasategui Avatar answered Sep 19 '22 21:09

Federico Berasategui