Last month I wrote a quick review for Visual Studio 11, which is literally a quick and general introduction to VS 11. The article today, as my exploration deepens, focuses on the improvements that are crucial for developers. They are:
- Windows Metro style apps
- Async feature and Caller information for VB & C#
- Parallel related improvements for C++
- New in Debugging
- New for data application development
- ASP.Net 4.5 and Web Development
- .Net 4.5
- Integration with Dynamsoft Source Control
1. Windows Metro style apps
Windows Metro style apps come with Windows 8. They are similar to Android apps and iOS apps but brand new on Windows platform. There’re two things you need to do before starting to develop and test these apps. First, you must install Visual Studio 11 on Windows 8. Second, you must obtain a developer license1 for the Windows Store.
The IDE of Visual Studio 11 is backward compatible. I can open all files, projects or solutions that were created in Visual Studio 2010 with SP1. The earlier versions like VS 6.0, VS 2003, VS 2005 are not tested yet. However, I strongly recommend you to upgrade your projects in avoid of any unex
The new Solution Explorer brings much convenience for developers to manage codes. We can left click on a file to preview the code inside, double left click to open it. The code preview tab is in the top-right of the code editor. See the screenshot below.pected problems.
We can now access the menus by pressing Ctrl+Q, and then entering search strings that contain @. This improvement makes it possible to use menus, tools and even complicated options that are hidden deep inside the menu tree without moving our mouse. What a time-saving feature!
Available shortcuts: @mru, @menu, @opt, @doc and etc.
The Code Editor now shows a long list of relevant members and really detailed tips automatically as you type. Its options are in Options > Text Editor. You may configure or turn it off as you like.
3. Async feature and Caller information for VB & C#
Async feature has been introduced to VB and C# 5, which makes asynchronous programming straightforward and neat. Check the sample code below. With only a few lines, the synchronous method GetURLConcents is converted to an asynchronous method GetURLContent.
In multithreaded object-oriented programming, asynchronous methods free up resources that are normally wasted while waiting for a long running operation to complete. Particularly when it is a UI thread, the whole application UI will freeze for a long time only because it is trying to fetch a big bulk of data.
I believe it’s the most favourable feature in VS 11 for many VB /C# developers. In before, if we want to make our code asynchronous to deliver a responsive user experience, we’ll have to write methods that return an extra argument, say “awaiting” or “continuation”, instead of returning a simple result. And this approach will make our code prolix, complicated and difficult to read.
4. Parallel related improvements for C++
C++ AMP4 programming model
Thanks to C++ Accelerated Massive Parallelism (C++ AMP), C++ execution now can make use of both GPU’s and CPU’s computation power.
C++ AMP provides an easy way to write C++ code that compile and execute on data-parallel hardware (commonly discrete graphics card). Basically we can use the library, methods, extensions and compiler restrictions that it includes to control how data is transferred between CPU memory and GPU memory. However, we cannot be too careful with time cost and data throughput overhead during the process, otherwise it will against the computational acceleration that can be achieved by parallel execution.
The new auto-parallelizer in C++ compiler enables our code to run more efficiently on multi-core and multiprocessor hardware. It reorganizes a loop automatically, but we can also use #pragma parallelize to control which loops to parallelize.
The C++ compiler recognizes and automatically vectorizes loops so that the CPU can execute several iterations in the same time. Material from Microsoft asserts ‘Vectorized loops can run up to eight times faster on CPUs that support vectorization’, which is definitely a huge boost.
New features: Strict Mode, Typed Arrays, Windows Runtime, Web Workers, Async Attribute
Visual F# in VS 11 beta features F# 3.0.
New features: Type Providers, Query Expressions, Auto-implemented properties
New in development environment: Parameter Help, Enhanced IntelliSense
For details, see reference5
6. New in Debugging
Debugging tools for Metro style app6
VS 11 includes a set of testing and debugging tools especially for Metro style app. For instance, Metro style simulator and Remote debugging.
We can now use GPU Threads and Parallel Watch windows to debug parallel applications. In addition, two new windows have been added:
GPU Threads window7: displays the status and details of the threads running on the GPU.
Parallel Watch window8: displays values of a single expression across multiple threads at the same time.
Note: GPU debugging in VS 11 only supports C++ AMP and requires Windows 8 or higher version operating system.
7. New for data application development
SQL Server Object Explorer
We can open it from View menu > SQL. This tool set is quite similar to the SQL Server Management Studio we’re using. With it, we can create, edit and delete SQL Server tables, table data, functions, as well as execute queries.
New Table Designer
We can now define and change the table definition through this graphical interface, the Script pane will update the table’s script definition accordingly.
SQL Server Express LocalDB9
This is a lightweight version of SQL Server that has most of the programmability features of a typical SQL Server database. It runs in user mode, light, fast, and the installation is configuration free.
It is possible to manage LocalDB using Visual Studio. You may still use SSMS though.
Database File Conversion
Before using existing database files (.mdf) in Visual Studio 11, you must convert them to the database file format of SQL Server 2012 RC 0.
Note: After upgrade, the database file will no longer be compatible with earlier versions of SQL Server.
8. ASP.Net 4.5 and Web Development
Installed browsers will appear in the drop-down menu next to Start Debugging button.
In VS 11, IIS Express becomes the default web server for testing web projects. As its name indicates, this is a lightweight, self-contained, optimized and configuration-free version of IIS. It enables us to test on a real IIS without being admin. When we start debugging a website, IIS Express runs automatically.
Right click on the website name and select Property Window, we can find option to enable SSL.
9. .Net 4.5
Key new features:
- .NET APIs for Metro style apps ;
- The Portable Class Library;
- Reduce System Restarts during installations;
- Support arrays larger than 2GB on 64-bit;
- Background garbage collection;
- Console support for Unicode (UTF-16) encoding;
- Regular expression timeout;
- Zip compression
10. Integration with Dynamsoft Source Control
Connect Dynamsoft TFS Hosted Server
- In the Team Explorer Window, click Sign up for Team Foundation Service to create account for Dynamsoft TFS Hosted Service.
- Click Connect to Team Foundation Server, and enter https://s01.tfshosted.com/tfs and your account.
Connect to Dynamsoft SCM Anywhere / SourceAnywhere Hosted
- Open Menu > Tools > Source Control > Plug-in Selection > Current Source Control plug-in.
- Select Dynamsoft SourceAnywhere Hosted or Dynamsoft SCM Anywhere Hosted MSSCCI plug-in.
Note: SCM Anywhere VSPackage doesn’t support VS 11 Beta yet. But I can promise our R&D team won’t have you wait too long.
- Getting a developer licence
- Getting started with Metro style apps
- Visual Studio 11 compatibility.
- C++ AMP
- What’s New for Visual F# in Visual Studio 11 Beta
- Debugging and testing Windows Metro style apps
- How to: Use the GPU Threads Window
- How to: Use the Parallel Watch Window
- Using LocalDB in Visual Studio 2010