Category Archives: Visual Studio 2017

VS 2017 – Revamped Start Page

When you open VS, the first thing that you notice is the Start Page. In VS 2015 the Start Page provided a useful way to open recent projects, look into tech news. But this is where it stopped.

VS 2017 has totally revamped the Start Page experience. It is visually more appealing and offers more options to improve developer’s productivity.

Visual Design and Layout

VS 2017 has improved Visual Design and Layout as you can see below.

Improved Start Page.PNG
VS 2017 Start Page

 

First thing that you immediately notice is that news section no longer takes more than 3/4th of the page. It is in fact toggle panel on the right hand side. This makes quite sense to me since as a developer when I open the Visual Studio most of the time i just want to start my development. I do not open VS just for news. 🙂

Recent

The recent section now offers more options to the developer. The user has now option to pin his favorite projects. The projects are now arranged neatly in chronological order making it far more intuitive and easy to use.

Visual Studio Recent.PNG
Start Page – Recent Section

One important thing to note here is that your Visual Studio settings go along with you wherever you sign-in. For example, let us say you created a project and committed it to source control in one machine. If you then sign-in and open VS 2017 in some other machine, that project would be available in your recent list. You can simply click the project and VS will give you option to set up the source control on your new machine.

Open

Open section now lets you checkout your project in source control directly from Start Page. This section will not only show Visual Studio Team Services but any other 3rd party source controls like GitHub.

Visual Studio Open.PNG
Connecting to your source control is just a click away

In addition to this you can also open a Project/ Solution, Folder or a Web Site directly from here.

New Project

The new project section saves you few clicks by showing your recent project templates to help you quickly start development. Again, recent templates moves with machines where you sign-in.

New Project template - Recent.PNG
Recent Project Templates

In addition to this you can search project templates directly from here. You can search by template name, type or language.

New Project template - Search.PNG
Search Project Templates from Start Page

Developer News

As mentioned earlier, the developer news section now comes as right toggle on Start Page. This section will be visible or hidden based on your preference. That is, you can either keep it open or collapsed as per your choice.

Developer News.PNG
Developer News section

If news section is collapsed, you do not need to worry about losing on news. You will be notified by a badge on the top right corner of the toggle icon.

Developer News Notification
Developer news – Batch

Hope this helps to you improve your productivity. Please share do your comments. Happy coding!!!

Advertisements

Visual Studio 2017 – The best IDE ever

Visual Studio 2017 was launched with much fan fare yesterday (March 7, 2017). I started exploring Visual Studio 2017 from RC and I must say, after using VS 2017 I felt I was earlier leaving in stone age. It is so much better.

In short the Visual Studio 2017 is equivalent to following:

VS 2017 = VS 2015 + Loads of 3rd party plugins (like NChrunch, few ReSharper features etc.) + Improved tooling, performance, experience, productivity etc.

Below, I have tried to highlight major features in Visual Studio 2017. This is not an exhaustive list but only few features which has helped me to improve my productivity significantly.

Faster Installation – Choose your workload

The first thing that you will notice while starting Visual Studio is that you got to chose what you want. Are you just a web developer? No worries, you only install just web workload. In fact, you can even chose what individual component you want to install within that workload. That means, lesser space, faster install time.

01-VS Installer
Visual Studio 2017 installer

Faster Load Time – Increase Productivity

One of the major pain-points with previous version of VS was that it used to taken an eternity to load a solution with lot of projects. You could actually launch your VS go for coffee, come back and it would still be loading. But, VS 2017 actually loads these project very fast. So, you no longer need to go to coffee, just open the project and start coding and leave home early 🙂

From my own experience, my solution contained around 92 projects. Opening them in Visual Studio 2015 could take anywhere between 2 to 3 minutes or even more. Sometimes, it would hang and I would need to start all over again. Worst still, if you had ReSharper installed like me, I could go for lunch along with coffee and come back before it loads.

 

VS 2015 - Preparing solution1
VS 2015 – Preparing Solution (You can go for a coffee)

With VS 2017, the same solution opens in less than 30 seconds. No more coffee breaks!

C# 7.0 Support

Visual Studio 2017 comes with C# 7.0. C# 7.0 has introduce lot of new features like Tuples, Switch Case improvements, Pattern Matching, Local Functions, etc.

// Example of tuple feature of C# 7.0
public (int sum, int difference) GetSumAndDiffernce(int a, int b)
{
       return (a + b, a - b);
}

You can get more details on C# 7.0 here.

Live Unit Testing

If you have used NChrunch, probably you would know what I’m talking about. Visual Studio 2017 brings in the support for live unit testing. VS 2017 runs unit test cases in background as you write your code. It means you simply write code and you will get an instant feedback on what unit test cases are failing or passing due to your change. Ideal for TDD. Makes your smarter and increase your productivity.

To enable Live Unit Testing in your solution go to Test -> Live Unit Testing -> Start

03-Live Unit Testing
Start Live Unit Testing
06-Live Unit test Example
Example of Live Unit Testing
Important Note: If you are using a .NET Core project. Then you are out of your luck. .NET Core does not support Live Unit Testing currently.
You will get following error in output window:
"Live Unit Testing does not yet support .NET Core"

Improvements in .NET Core Tooling

Back in VS 2015 days, .NET Core tooling was still in preview. If you were early adopters of .NET Core you would know what a pain it was. With VS 2017 the tooling has come out of preview and moved to 1.0. In addition to this you have MS Build support.

Once, you open an existing .NET Core project written in Visual Studio 2015 is “One-way upgrade” dialog as shown below. On clicking OK it will migrate your existing VS project to a newer version automatically.

02-Project Upgrade1.PNG
.NET Core One-way upgrade

Why this upgrade? This is because, VS 2017 no longer supports project.json and xproj. It is replaced by csproj. The csproj itself is no longer complicated as earlier. You can edit csproj file and add/ remove references without unloading the project. The csproj file also supports intellisense.

05-Edit CSProj.PNG
Simplified csproj file with intellisense 

 

Docker Support

Vs 2017 supports containers out of the box. While creating a new project you get an option to enable Docker Support.

04-Enable Docker
Enable Docker Support
Important Note: Before you enable Docker Support in your project, make sure you have Docker installed in your machine. 

Else, your build will fail with error: "Microsoft.DotNet.Docker.CommandLineClientException: Unable to run 'docker-compose'. Verify that Docker for Windows is installed and running locally."

If you do not have the tools, you can enable Docker support later as well.

There are many other features which I have not listed down here. For the complete list please refer to VS 2017 release notes.

Happy Coding!!!