5 Incredible Features in the Visual Studio 2015 Preview

vs_2015_header

The Visual Studio 2015 Preview included many new features that enhanced the way developers work with everything from the web and desktop to mobile apps. Several features have had the spotlight, such as gesture support in the editor, Cordova tooling, C++ enhancements and the new Android emulator. But there are several other, less talked about features that I feel every developer that uses Visual Studio 2015 will benefit from. With that said, lets jump straight in!

1. Custom Windows Layouts

This feature comes in handy if you develop on multiple devices. Say for example that you use a Surface Pro to develop on your train ride home and a 23″ monitor during the day. You can quickly switch between devices by going to Window -> Apply Window Layout and selecting one that you created earlier. They also have support for keyboard shortcuts so that you can quickly navigate to your favorite layout and the profile roams with you as long as you are signed into Visual Studio 2015.

Below is an example of switching between my Surface device and my Desktop Monitor. You will notice that with the Surface, I want to only show the XAML file whereas, with my large monitor, I want to see everything.

windowswitch

2. Better Code Editor

The code editor has been replaced with “Roslyn” to give you a new and improved code editing experience. Light bulbs are shown when you need to include fixes to your code or refactor it. Whenever you see a light bulb appear, then click it and it will give you suggestions based upon the code it has analyzed.

In this sample, it has determined that we included unnecessary “using” statements and helps remove them. Before doing so, you can generate a preview and have the changes affect the whole document, project or solution. While these features have appeared in JustCode and earlier versions of Visual Studio for years, we will be releasing a new version of JustCode for Visual Studio 2015 that will take advantage of Rosyln for enhanced productivity tools.

lightbulb

3. Shared Project – “All the Things!”

How many times have you wanted to use a Shared Project outside of a Windows Universal App? Now you can! After you open Visual Studio 2015 and search for “shared” then you will see the following:

sharedproject

Go ahead and select the Visual C# Shared Project and create a class named Person.cs and add the following code:

class Person
{
    public string FirstName { get; set; }
    public Person()
    {
        FirstName = "Michael";
    }
}

Create a new Console application and reference the Shared Project that we just created. Now you can write code such as :

var person = new Person();
Console.WriteLine(person.FirstName);
Console.ReadLine();

If you run the console app, you will see it retrieved the FirstName from our Shared Project. Go ahead and add a WPF or Windows Form application and access the Person class like you normally would. This also works for class libraries as well. After I’ve added several projects, my solution explorer looks like the following:

multipleproj

Notice that the only thing I had to do was reference the Shared Project.

4. IntelliSense for Bower and NPM

If you create a new ASP.NET 5 Web Project, you will notice several things that the new project template loads as shown below.

IntelliSense for Bower and NPM

Besides a updated file structure, you now have a folder called Dependencies that contains Bower and NPM. Generally speaking, you can think of Bower for client-side packages (such as jQuery and Angular) and NPM for developer tools (such as Grunt and Gulp). Both of these package managers are controlled by JSON files found in the solution.

  • bower.json for Bower
  • config.json for NPM

If we wanted to add a library using Bower, we would simply open the bower.json file and add the package that we want. In this case, I want to add the latest version of Angular without having to go to the Angular site and manually download it and add it to my project.

DataBinding for XAML

Once added, you will see that we have the option to install/update or delete the package or view the homepage from the drop-down menu. This will come in handy as you are working with web projects.

5. Debug Lambdas

Yes, the time has finally come where we can debug lambda expressions. Let’s take a look at the following code:

List<int> elements = new List<int>() { 10, 20, 31, 40 };
// ... Find index of first odd element.
int oddIndex = elements.FindIndex(x => x % 2 != 0);
Console.WriteLine(oddIndex);

The console will return the value of 2. But what if we wanted to add a watch and perform additional analysis of the expression as shown below.

DataBinding for XAML

In this sample, we added a watch on the breakpoint and added the following code:

elements.Where(v => (int)v > 11).ToArray()

As expected, it returned 3 items that were greater than 11. This will be a lot of help as you can use this in the immediate, and other debugger windows as well. It is also supported in both C# and Visual Basic.

BONUS TIP!!! Blend for Visual Studio 2015 Actually Rocks

Blend comes with several enhancements but, by far, the one that was needed the most is the overhaul of the UI as shown below. You will quickly find that Blend includes most of the functionality that we have grown to love in Visual Studio.

Blend for Visual Studio 2015

Some of the notible features are :

  • Basic Debugging Support
  • Peek in XAML
  • Custom Windows Layouts as shown in feature #1
  • Source Control
  • NuGet
  • and finally…

XAML IntelliSense!

Blend for Visual Studio 2015

Just after a few minutes of playing with the new Blend, I can tell Microsoft is committed to making the Blend experience similar to the Visual Studio one.

More Awesomeness Coming from Visual Studio and Telerik

So far, we’ve only seen the first preview of Visual Studio 2015. With the new feedback options, I can only assume that it will get better. Since the release, we’ve been playing with the new bits, as described here. If you are looking for ways to enhance your web, desktop or mobile applications, then take a look at our DevCraft Suite. I’d also encourage you to take a look at the Telerik Platform for cross-platform mobile applications using HTML5, CSS3 and JavaScript.

Also, if I missed a featured then sound off in the comments below. I’d love to hear your feedback as you were pretty vocal in the Windows 10 post. If you need to get up to speed with everything that has happened with .NET over the past couple of weeks then I’d suggest you read Sam Basu‘s post on the “Future of .NET“. Until next time, Michael signing off.

Header image courtesy of David Woo

DevCraft

Comments

  • Pingback: Dew Drop – December 1, 2014 (#1905) | Morning Dew()

  • Pingback: The Morning Brew - Chris Alcock » The Morning Brew #1749()

  • Tom Walker

    My top 3 VS2015 features 1- XAML IntelliSense 2- Peek in XAML 3- Better Code Editor.

    • Nice list! I was very happy when VS 2013 added IntelliSense support for DataBinding and Resources in XAML.

  • Tom Walker

    My top 3 VS2015 features 1- XAML IntelliSense 2- Peek in XAML 3- Better Code Editor.

    • Nice list! I was very happy when VS 2013 added IntelliSense support for DataBinding and Resources in XAML.

  • Mine would probably be the Emulator for Android. You can now see Kendo UI elements in all their mobile glory :).

    • Thanks for sharing. I also enjoy the Android Emulator as it is lighting fast. I just wish it worked with Android Studio as well. 😉

  • David Kislingbury

    Mine would probably be the Emulator for Android. You can now see Kendo UI elements in all their mobile glory :).

    • Thanks for sharing. I also enjoy the Android Emulator as it is lighting fast. I just wish it worked with Android Studio as well. 😉

  • vijaya malla

    I Like fastbuild with Roslyn, Emulator For android coz i am into cross platform development

    • +1! Since you are into cross-platform development have you given the Telerik Platform a try? We have Visual Studio templates and *no mac* is required to produce an IPA. http://platform.telerik.com

  • vijaya malla

    I Like fastbuild with Roslyn, Emulator For android coz i am into cross platform development

    • +1! Since you are into cross-platform development have you given the Telerik Platform a try? We have Visual Studio templates and *no mac* is required to produce an IPA. http://platform.telerik.com

  • vijaya malla

    And a lot of JustCode style editor support

  • vijaya malla

    And a lot of JustCode style editor support

  • Dr. Syn

    I love the better code editor and, thanks to Scott Hanselman’s HackSummit talk, the Intellisense for Bower and NPM. Anything to help me as I learn how-to. The custom layouts will definitely come in handy too.

  • Dr. Syn

    I love the better code editor and, thanks to Scott Hanselman’s HackSummit talk, the Intellisense for Bower and NPM. Anything to help me as I learn how-to. The custom layouts will definitely come in handy too.

  • loving the ability to debug lambdas! now I can tweak them with real data in the immediate window at runtime!

    • I think this is one of the most loved features of the IDE. 🙂

    • I think this is one of the most loved features of the IDE. 🙂

  • loving the ability to debug lambdas! now I can tweak them with real data in the immediate window at runtime!

  • Pingback: Top 10 links of the Week #42 |12/05/2014 | The SoftFluent Blog()

  • Pingback: Sony Hackers - The Daily Six Pack; December 8, 2014()

  • Pingback: What's New in C# 6.0 inside Visual Studio 2015 PreviewTelerik Developer Network()

  • Md.Ibrahim

    What was that Mac OSX like animation on window maximizing in the screenshot of “4. IntelliSense for Bower and NPM” ??

  • Jay

    Is codelens still Ultimate only?

    • Василий Игнатов

      Ultimate and Professional

  • Jay

    Is CodeLens still Ultimate only?

  • I like Debug Lambda and seem Code editor reuse many ideals from Reshaper. Anyway it’s very good for developer. Thanks Microsoft and Crump for this introduction.

  • What do you use to create the GIF screen recordings?

  • Also worth to mention the new NuGet packages manager!

  • Scott Emick

    Does Visual Studio 2015 fix the totally broken membership? In Visual Studio 2013 it is completely unusable out of the box in a new web forms project.

  • thornik

    Is it all what they offer for XAML? What about conditional directives? (like #if in C#) Have multiple layouts above same controls? Preview of styles (without Blend)?