First Hours with Visual Studio Code on Mac and Windows

Today is one of those awesome days if you build stuff on .NET platform. They announced bunch of stuff during Build 2015 keynote and one of them is Visual Studio Code, a free and stripped down version of Visual Studio which works on Mac OS X, Linux and Windows. Let me give you my highlights in this short blog post :)
29 April 2015
3 minutes read

Related Posts

Today is one of those awesome days if you are building stuff on .NET platform. Microsoft announced bunch of stuff at Build 2015 keynote a few hours ago and one of them is Visual Studio Code, a free and stripped down version of Visual Studio which works on Mac OS X, Linux and Windows. It leverages bunch of existing open source software like OmniSharp, Electron. Most of all, this was my #bldwin wish :)

First of all, you should definitely install Visual Studio Code and start checking the documentation which is very extensive. I followed those steps and as I am very excited about this new tool, I wanted to share my experience thus far which is not much but very promising.

First thing I noticed was the top notch support for ASP.NET 5. The documentation for ASP.NET 5 support is pretty good but some features are not highlighted there. For example, you are getting the IntelliSense for dependencies:

Ekran Resmi 2015-04-29 19.26.46

When you add a dependency, you get nice notification telling that you should restore:

Ekran Resmi 2015-04-29 19.59.55

Pretty nice! So, how would you restore? Hit ⇧⌘P to get the command pallet up and you can see the restore command there:

Ekran Resmi 2015-04-29 21.45.20

It will run the restore inside the terminal:

Ekran Resmi 2015-04-29 21.48.30

You can also invoke your commands defined inside the project.json:

Ekran Resmi 2015-04-29 20.09.09

Ekran Resmi 2015-04-29 20.10.14

Obviously, you can change the theme.

Ekran Resmi 2015-04-29 20.18.35

Writing C# code is also very slick! You currently don’t have all the nice refactoring features you have in full fledged Visual Studio but it’s still impressive:

Ekran Resmi 2015-04-29 20.19.57

Ekran Resmi 2015-04-29 20.22.43

We even have some advanced stuff like Peek Definition:

Ekran Resmi 2015-04-29 20.02.29

Check out the documentation for all coding editor features.

As mentioned Windows is also fully supported as you might guess :)

Screenshot 2015-04-29 20.35.16

Screenshot 2015-04-29 21.18.29

Screenshot 2015-04-29 21.23.36

I want to touch on the Git integration as well. I generally use Git bash and this won’t change for me but having the diff view inside the editor in a very nice way is priceless!

image

How about old/current .NET applications? I managed to get one up and running easily and managed to get the build working by defining a task for that:

{
	"version": "0.1.0",
	
	// The command is tsc.
	"command": "msbuild",

	// Show the output window only if unrecognized errors occur. 
	"showOutput": "silent",
	
	// Under windows use tsc.exe. This ensures we don't need a shell.
	"windows": {
		"command": "C:\\Program Files (x86)\\MSBuild\\14.0\\Bin\\msbuild.exe"
	},
	
	// args is the HelloWorld program to compile.
	"args": []
}

image

I was expecting this to work without any further configurations but it could be just me not being able to get it working.

As said, it’s very early but I am sold for this editor! Also, this is a fantastic time to build products on .NET platform. I would like to thank all the people at Microsoft and open source community who are making our lives easier and enjoyable. I will leave you all now and enjoy my new toy! :O