Visual Studio Preview includes a number of powerful new features, whether you're in Web application development, desktop application development, or even mobile application development, VS 2015 will greatly improve your development efficiency. There are several features that are very bright, such as the editor support gesture recognition, the Cordova Toolkit, the C + + enhancement tool, and the latest Android emulator. Some of the other features, though rarely mentioned, personally feel that we can benefit from the development of VS 2015, and take a look at them.
1. Customizing the Window Layout
If you're developing apps on multiple devices, that's a handy feature for you to develop. For example, if you're using Surface Pro on your home train and you're working on a 23-inch monitor, you can quickly switch the layout of your development environment to fit your current device type using window--------Apply window layout. If you are logged in VS 2015, you can also use the shortcut keys to switch the layout of the development environment, which is very convenient.
2. Better Code Editor
The code editor has been replaced with "Roslyn", which will bring you a different code editing experience. When you want to fix the code, there will be a small light bulb, which will provide you with a series of repair code options, you just have to choose.
In the example below, the code refers to unnecessary namespaces, and we need to remove them from the code. Before we do that, we can preview the final effect and the other code that will affect it.
3. Shared Project Integration
How many times do you want to use the shared Project feature outside of Visual Studio, but now it's all right, you just need to search for shared, and the following interface will appear:
Select Visual C # Shared Project, and then create a new class named Person.cs, and write the following code:
Class person{Public string FirstName {get; set;} Public person () { FirstName = "Michael"; }}
Create a console application that references the shared project project you just created, and you can write the following code:
var person = new person (); Console.WriteLine (person. FirstName); Console.ReadLine ();
You can also create a WPF application that references a shared project project, and here's My Project map:
4. Code intelligence tips in Bower and NPM
If you create an ASP. NET 5 Web application, the system will automatically generate the following directory structure for you:
This will generate a folder called dependencies, which contains Bower and NPM, in general, you can think of Bower as a client-side development package, such as jquery and angular script library, can be seen as a development tool, NPM Like Grunt and gulp. These development packages are managed in a JSON-formatted file.
- Bower.json for Bower
- Config.json for NPM
If you want to add a class library to the bower, you can open the Bower.json file and add your own class library. In the following example, I would like to add the latest angular library, but do not want to open the angular website download, specific actions such as:
Once added, we'll see the Install/Update/delete menu options, which will help us develop Web applications more conveniently.
5. Debug Lambdas expression
Now that we can debug the lambda expression, 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);
This program will output 2 in the console, but if I want to see the results of each step, refer to:
In this example, we add a monitor and a breakpoint, and add the following code:
Elements. Where (V-= (int) v > 11). ToArray ()
As expected, the program returns 3 results greater than 11, so that we can debug the application more conveniently and more directly.
5 Incredible vs 2015 preview new features