Welcome to Introducing .NET 4.5.
It is my pleasure to be your guide (along with my coauthors) as we take you through the best that Visual Studio 2012 and .NET 4.5 have to offer, covering everything from Async to WPF (er, well, OK, maybe not WPF so much).
About two years ago, I wrote a book (Introducing .NET 4.0 with Visual Studio 2010). This was an ambitious (and time-consuming!) project where I set out to provide a high-level overview of all the major changes across the framework from ASP.NET to WCF.
I had some specific ideas in mind when writing the previous book:
This book is about breadth rather than depth. It will get you up-to-speed quickly on new functionality in just enough depth to get you going but without getting bogged down with too much detail.
When something big like Visual Studio 2010 is released, I believe developers need and want an overview of what’s new. When they find an area of interest, they can then research it further.
When writing it, I tried to keep in mind the following objectives:
The book was well received (although not quite as well as one involving wizarding schoolchildren or lame-ass vampires) and enjoyed high sells, leading me to believe that there was a need for such a text (if not, don’t buy it—it only encourages us!). Thus, despite promising myself that I wouldn’t write another book in a hurry, I find myself writing about the changes in .NET 4.5 and Visual Studio 2012.
This book has the same aims as the previous book. However, I have also made a few changes to address what I felt were weaknesses of the first text.
Given the breadth of the subject matter, it was impossible to cover all the subject areas in as much detail as each topic deserved. Some chapters of the first book were much stronger and more in-depth than others. Sometimes the level of depth reflected the information available, but my own areas of interest and knowledge also influenced how thoroughly I covered any given topic. So, this time—with the added bonus of not having to do quite as much work!—I have taken some friends and colleagues along for the ride. It is my pleasure to introduce you to my fellow authors, Mahesh Krishnan and William Tulloch. I had the (dubious?) pleasure to work with Mahesh and William at the Australia-based consultancy Readify (www.readify.net
). Mahesh specializes in the areas of Azure, WCF, and Silverlight, and he is the author of Microsoft Silverlight 4 for Dummies. William specializes in WCF and WIF.
As I write this, Visual Studio 2012 has yet to be released so it is very likely that there will be last-minute changes that won’t make it into this book. As we become aware of these changes, we will release corrections and updates on the Apress web site.
Documentation and examples are also lacking in some areas, which has made researching them very difficult (particularly the core CLR changes), and some/most of the Microsoft teams were, er, not so chatty when asked for further information.
This book covers the core changes in .NET 4.5 and Visual Studio 2012. We have also included chapters on current and upcoming technologies included in this release, such as ASP.NET MVC 4, Windows Azure, and Silverlight 5, which we believe will be of interest to readers.
We will not be covering some of the great new Team Foundation Server–related changes (these are huge and would require several books to discuss). We will only be covering the “core” IDE features. We have also had to make decisions as to which features and changes will be of most interest and/or importance to our readers so we have had to drop some of the minor changes. Additionally, to save space, examples are provided in C# only although we have covered changes to VB.NET.
We have tried to keep examples as short as possible to avoid obscuring the concepts we are trying to demonstrate with plumbing code and also to keep typing to a minimum, but you can obtain a download of some of the longer sections and examples from my web site at simpleisbest.co.uk/vs2012
.
Every release of .NET and Visual Studio tends to have a core set of themes or improvements. Visual Studio 2010’s dominant themes, in my opinion, were parallel programming, dynamic types, extensibility, and bringing C# and VB.NET into line.
So, what are the big themes in .NET 4.5 and Visual Studio 2012?
Well, we have the rest of the book to answer that question, but if I had to pick the top five themes, they would include the following:
The biggest change in .NET 4.5 is a much-improved async programming model. Async programming techniques can keep our applications more responsive and help us make optimal use of available resources.
Traditionally, async programming has been rather tricky (and you’d probably be wearing sandals and own a rather good neck beard to really understand it); however, with .NET 4.5, we have an excellent and intuitive model with the new await
and async
keywords. The await and async model drastically reduces the amount of code you need to write, resulting in easier-to-maintain and more readable applications. A huge number of methods and classes in the base-class library has been upgraded to support this new model. The new WinRT framework (for developing Windows 8 applications) only supports Async APIs, illustrating just how important Microsoft believes this concept to be.
Other development languages such as Ruby have long had an easy-to-use method for distributing, installing, and updating APIs (Gems in Ruby’s case). Sometime in 2011, Microsoft released its own distribution framework called NuGet. NuGet enables you to easily include (or publish your own) libraries from either Microsoft’s NuGet repository or a specified location.
With Visual Studio 2012, Microsoft will be using NuGet as the distribution and update method for a number of frameworks such as Entity Framework and ASP.NET MVC. When you first create certain types of projects, Microsoft’s NuGet repository will automatically be contacted to obtain the latest version. This is great news as it means that Microsoft can push out updates much quicker and, I suspect, it will also encourage the uptake and distribution of open-source projects.
Visual Studio 2012 provides improved support for HTML5, CSS3, and WebSockets (IIS 8 only) through IDE changes, additional APIs, and the updating of existing components.
Visual Studio 2012 is an excellent choice for developing applications for many different platforms including Windows Phone, Xbox, and Windows 8. Visual Studio 2012 has a number of new project templates, additional libraries, improved IDE components, and enhancements such as portable libraries.
Microsoft has become much more open in the last few years. For example, ASP.NET MVC source code has been available since its earliest version, Microsoft teams have contributed to open-source projects such as jQuery, and we have seen the ASP.NET Web API and ASP.NET web pages (Razor) released under the Apache License.
Microsoft even says that for some of these projects, it will accept contributions and bug fixes from the community. (Don’t worry—they will, of course, review them!) This should result in better products for everyone.
Visual Studio 2012 comes in the following flavors:
Visual Studio Professional edition will be more than adequate for the majority of developers, but for a full breakdown of features please consult www.microsoft.com/visualstudio/11/en-us/products/compare
.
I have asked a number of different people in the development industry what their highlights and favorite features of .NET 4.5 and VS2012 are. Here are their responses:
http://mitchdenny.com and ttp://mitchdenny.com/about/
Visual Studio 2012 and .NET 4.5 are each significant releases in Microsoft’s developer platform. VS2012 will open up the ability for developers to target Microsoft’s new WinRT platform using either C++, .NET, or JavaScript bindings all within the one unified IDE. For .NET developers, the .NET 4.5 runtime represents the continued drive to make .NET the most productive and powerful development environment available. The increased focus on asynchronous programming capabilities in the C# language, the framework, and the IDE mean that developers have what they need to produce high-performance solutions and responsive user interfaces.
brendanforster.com
I’ve limited myself to three things I like about the upcoming stuff:
And a shiny feature not specific to this release: Reactive Extensions—mind-warping fun to code with.
packtpub.com/microsoft-visual-studio-2012-first-look-cookbook/book
Visual Studio 2012 makes good on Microsoft’s overarching goal of making developers “raving fans”. This is now one very quick IDE! It’s newfound speed and responsiveness belies the vastness of the functionality it offers and is by far the best version of Visual Studio that Redmond has produced so far. Visual Studio 2012 doesn’t just enable you to develop new Windows 8 style apps or make it easier to take advantage of modern multi-core hardware, it will also greatly improve your overall productivity and enjoyment when working on existing applications and that’s worth the price of admission alone!
And the book’s authors and technical reviewer:
http://plaureano.blogspot.com.au/
My top favourite feature for .NET 4.5 is ReJITting:
http://chanel9.msdn.com/Shows/Going+Deep/CLR-45-David-Broman-Inside-Re-JIT
ReJITting is a step in the right direction for Microsoft, but it still falls short compared to the great IL rewriting tools that are out there, such as Cecil.
What am I most excited about with the upcoming changes to the .NET ecosystem? The changes to the asynchronous programming model provide a compelling and simple means for starting to build really responsive, dynamic, and interactive applications. Coupled with the design implications of Windows 8, it’s a real push for software authors to start thinking more about how applications are consumed across multiple formats and needs.
There are number of developer-centric enhancements to the IDE that I think are exciting as a Visual Studio user. The interaction model Visual Studio is moving toward is making a big change to how I work—it’s helping me focus on getting my current job done, allowing me to finish and deliver. A win for me and the clients I work with.
Outside of what I love, I think I’m looking forward to seeing how Web API evolves the mindset of the people I see working with .NET and the web. It’s a great offering that I think will trigger a lot more semantic interaction with web-based resources.
simpleIsBest.co.uk
.NET 4.5 and Visual Studio 2012 contain some real game changers such as Windows 8 applications and Async functionality. The new Windows 8 design is a really exciting and brave move by Microsoft and it will be interesting to see how it pans out. Windows 8 apps certainly have their issues and limitations at the moment (I am sitting opposite some developers working on a project and hearing various frustrations—Josh and Dan, I am talking about you here!) but there is no doubt its very innovative.
I am a little skeptical about developers wanting to create Windows 8 applications using JavaScript and HTML5 as feel developers skilled in these languages will probably stick to web sites. The web purists will also probably not like some of the proprietary APIs (although let’s face it, this is becoming increasingly common with vendor prefixes) and that MS has tried to make JavaScript look a little like C# in places. Web sites are, of course, usable on pretty much any platform whereas the new design will be confined to use on Windows 8 and the next generation of Windows phones, which feels limited to me when I have limited time to invest in learning new skills.
I predict that XAML/C# will probably be the language and framework of choice for Windows 8 app development (and developers creating desktop applications will probably stick with what they know), but it is nice to see the flexibility to create applications using traditionally web-focused languages.
My top three changes in this release are:
Alex has asked me to nominate some of my favorite features in this release of the framework, and I must admit picking any particular thing is not easy but here goes:
Every time a new version of the framework, C#/VB.NET language or the IDE is released, .NET developers get excited. They try to learn what’s been updated, what’s new, and what feature doesn’t exist anymore. They try and figure out the coolest additions and guess what the next big thing is. I am no different—looking at all the things Visual Studio 2012 and .NET 4.5 have to offer, I’ve come to the following conclusions:
On with the book and we await
your feedback.
Alex Mackey, William Tulloch, and Mahesh Krishnan