With about 10 years since its first release, Microsoft's .NET Framework 4.5 is one of the most solid development technologies for creating casual, business, or enterprise applications. It has evolved into a very stable and solid framework for developing applications, with a solid core called the CLR (Common Language Runtime). Microsoft .NET Framework 4.5 includes massive changes and enables modern application and UI development.
Microsoft .NET Framework 4.5 Quickstart Cookbook aims to give you a runthrough of the most exciting features of the latest version. You will experience all the flavors of .NET 4.5 hands on. The "How-to" recipes mix the right ingredients for a final taste of the most appetizing features and characteristics. The book is written in a way that enables you to dip in and out of the chapters.
The book is full of practical code examples that are designed to clearly exemplify the different features and their applications in real-world development. All the chapters and recipes are progressive and based on the fresh features of .NET Framework 4.5.
The book is divided into functional examples that combine many techniques to showcase the usage of a concrete .NET 4.5 feature.
Chapter 1, Windows Store Apps, shows us the basics, 101, of creating Windows Store apps and some key aspects of it, such as adding a splash screen, tiles, understanding the Windows 8 lifecycle model, and using toasts.
Chapter 2, Exploring the Top New Features of the CLR, helps us explore some of the most exciting features of the CLR, such as portable class libraries, controlling timeout on regular expressions, overriding the default reflection behavior, and understanding how to use async
and await
.
Chapter 3, Understanding the New Networking Capabilities, explores the new networking features and show us how to use the HttpClient
and System.Net.Http
namespaces.
Chapter 4, Understanding the New Features of Entity Framework 5.0, helps us explore Code First and Code First Migrations directly.
Chapter 5, Understanding the New Features of ASP.NET, helps us explore the new capabilities while creating an ASP.NET web forms application; it shows us how to use unobtrusive validation and explains what it is good for; and it focuses on the other improvements, such as smart tasks, WAI-ARIA support, and "extract to user control" between others.
Chapter 6, Implementing WPF New Features, covers the new way of handling errors in WPF asynchronously with INotifyDataErrorInfo, use the WeakEvent pattern with the WeakEventManager class, bind to static properties, Throttling data source update delays and LiveShapping, and repositioning elements in the view when its bound data gets updated.
Chapter 7, Applying the New WCF's Features, helps us explore some of the most interesting features of WCF, such as its asynchronous support, WebSockets, and Contract First development.
Chapter 8, Creating and Hosting Our First ASP.NET Web API, basically explores this amazing new feature under the ASP.NET umbrella: web API. We will be creating a basic web API, adding CRUD capabilities, and self-hosting it.
Chapter 9, Using the New Capabilities of WF, explores one of the most exciting updates for .NET 4.5; it comes, greatly polished, with a mature and greatly enhanced framework for the workflow foundation. Here we explore creating a state machine workflow and new designer capabilities.
Appendix A, Resources for Further Knowledge, provides key references to websites of interest regarding the areas covered in this book.
Appendix B, NET 4.5, Deployment Risks and Issues, will show us some issues that can happen when applying .NET 4.5 to an existing project and on its deployment, such as the limitation on platform, different behaviors of the .NET framework, and that some things that might work properly in our developer environment might not work as well when deployed.
For working through this book, .NET 4.5 is needed together with Visual Studio 2012; we recommend either the professional or a superior version. Regarding the operating system, Windows 8 is needed for some aspects as well, so it is the recommended operating system.
If you are a .NET developer and would like to learn the new features in .NET 4.5, this book is just for you. Prior experience with .NET Framework would be useful but not necessary.
Microsoft .NET Framework 4.5 Quickstart Cookbook gives architects and project managers a high-level overview and clear understanding of what the .NET 4.5 Framework provides and how it can be used.
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text are shown as follows: "We can include other contexts through the use of the include
directive."
A block of code is set as follows:
using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks;
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
ToastTemplateType toastTemplate = ToastTemplateType.ToastText01;
XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(toastTemplate);
XmlNodeList toastTextElements = toastXml.GetElementsByTagName("text");
New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "clicking the Next button moves you to the next screen".
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply send an e-mail to <[email protected]>
, and mention the book title via the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <[email protected]>
with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
You can contact us at <[email protected]>
if you are having a problem with any aspect of the book, and we will do our best to address it.