Why Visual Studio 2017? Let Us Try It

Here, we are going to a see some live action of the brand new Visual Studio 2017. Please be noted that this is not the complete series of new functionalities of Visual Studio 2017. Here, I have shared only a few things to get you started with the new Visual Studio 2017. Now, let’s begin.

Background

Today, the wait is over. Visual Studio 2017 is released, so I thought of trying it out. That’s how this article is made. If you never used Visual Studio, you can find some articles and code snippets related to it here

Installing Visual Studio 2017

You can always install the brand new Visual Studio 2017 from here. While installing, you can select the things you may need, for example - if you are a Xamarin developer, you can select the Xamarin. Visual Studio 2017 has option for it. This makes the installation pretty much faster. Once you install, it is time to launch.


After_installing_Visual_Studio_2017

You can always set the development settings and theme as per your choice. This feature is already available in other lower versions too. Just thought to say it.


Selecting_theme_in_Visual_Studio_2017

Recent, Open, New project template

In the start screen, you can see some slight changes like preceding.

  • Recent
    This is where your recent projects will be shown, so that you can easily open it up.
  • Open
    This helps you to open the projects you need in an easy manner. It is not only helping to open a project from your local computer, but also from Visual Studio Team Services. Things are pretty much easier now. Right?
  • New project
    Here, you can see the templates that you recently worked with, and you can always search new templates too.

Recent_menu_and_open_menu_in_Visual_Studio_2017

Creating first Visual Studio Applciation

Now, let’s create an empty MVC application and a Controller in it.

  1. namespace WhyVisualStudio2017.Controllers {  
  2.     public class HomeController: Controller {  
  3.         // GET: Home  
  4.         public ActionResult Index() {  
  5.             return View();  
  6.         }  
  7.     }  
  8. }  
Now, if you look at the preceding image, you can see that there are dotted lines between the namespaces, classes, methods. 


New_layered_structure

This will help you to understand how the namespaces, class, methods are related to. If you have wrked on heavy projects where you can have 1000s of lines of code in a single class, you may find this feature very useful.

Now, let’s create a Model class as preceding.

  1. using System;  
  2. using System.Collections.Generic;  
  3. using System.Linq;  
  4. using System.Web;  
  5. namespace WhyVisualStudio2017.Models {  
  6.     public class Calculator {  
  7.         public static int CalculateMe(int v1, int v2) {  
  8.             return v1 * v2;  
  9.         }  
  10.     }  
  11. }  

Go back to your Controller and type ‘cal. You can see the new intelliSense where you can separate the lists by classes, snippets, interfaces etc.


New_Intellisense_feature


New_Intellisense_feature

Now, if you have given your function a name as in camelCase manner, the Visual Studi 2017 will give a suggestion to rename it, as shown below.


Naming_Suggestions_in_Visual_Studio

As an additional feature, if you click on the "Preview Changes", you can get to know where exactly your recent code changes may affect and what fix you can give.


Preview_Changes_in_Visual_Studio

Searchig for a file is quite easier in Visual Studio 2017; all you have to do is type CTRl + . You will see a box, as preceding.


Find_files_in_Visual_Studio_2017

You can select any kind of files by typing the file name.


Find_Files_in_Visual_Studio




You can always use the filters given there in the box.

Another important feature available in Visual Studio 2017 is Exception User Handled. If you get any error, the Visual Studio 2017 will inform you where exactly the error is. For example, we all know the following codeblock will give you a null reference exception.

  1. List < string > lstString = new List < string > ();  
  2. lstString = null;  
  3. lstString.Add("Sibeesh");  
Now, if you run your application, Visual Studio 2017 will give you the entire details of the error.


Exception_User_Handled_In_Visual_Studio_2017

In the exception box, it is mentioned as lstString was null.  For every developer, one big headache is finding where exactly the error occurs. Now, Visual Studio 2017 makes that much easier. Way to go. That’s all for today. I will come with all the features of Visual Studio 2017 very soon. Happy coding!.

References

See also

Conclusion

Did I miss anything that you think  may be needed? Did you find this post useful? Please share me your valuable suggestions and feedback.

You can see this article in my blog here.

Your turn. What do you think?

A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.

Up Next
    Ebook Download
    View all
    Learn
    View all