Book Image

Visual Studio 2010 Best Practices

By : Peter Ritchie
Book Image

Visual Studio 2010 Best Practices

By: Peter Ritchie

Overview of this book

When you are developing on the Microsoft platform, Visual Studio 2010 offers you a range of powerful tools and makes the whole process easier and faster. After learning it, if you are think that you can sit back and relax, you cannot be further away from truth. To beat the crowd, you need to be better than others, learn tips and tricks that other don't know yet. This book is a compilation of the best practices of programming with Visual Studio. Visual Studio 2010 best practices will take you through the practices that you need to master programming with .NET Framework. The book goes on to detail several practices involving many aspects of software development with Visual Studio. These practices include debugging and exception handling and design. It details building and maintaining a recommended practices library and the criteria by which to document recommended practices The book begins with practices on source code control (SCC). It includes different types of SCC and discusses how to choose them based on different scenarios. Advanced syntax in C# is then covered with practices covering generics, iterator methods, lambdas, and closures. The next set of practices focus on deployment as well as creating MSI deployments with Windows Installer XML (WiX)óincluding Windows applications and services. The book then takes you through practices for developing with WCF and Web Service. The software development lifecycle is completed with practices on testing like project structure, naming, and the different types of automated tests. Topics like test coverage, continuous testing and deployment, and mocking are included. Although this book uses Visual Studio as example, you can use these practices with any IDE.
Table of Contents (16 chapters)
Visual Studio 2010 Best Practices
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface

Preface

When you are developing on the Microsoft platform, Visual Studio 2010 offers you a range of powerful tools and makes the entire process easier and faster. After learning it, if you think that you can sit back and relax, you cannot be further away from truth. To beat the crowd, you need to be better than others, learn tips and tricks that other don’t know yet. This book is a compilation of the best practices of programming with Visual Studio.

Visual Studio 2010 Best Practices will take you through the practices you need to master programming with the .NET Framework. The book goes on to detail several practices involving many aspects of software development with Visual Studio. These practices include debugging, exception handling, and design. It details building and maintaining a recommended practices library and the criteria by which to document recommended practices.

The book begins with practices on source code control (SCC). It includes different types of SCC and discusses how to choose them based on different scenarios. Advanced syntax in C# is then covered with practices covering generics, iterator methods, lambdas, and closures.

The next set of practices focus on deployment, as well as creating MSI deployments with Windows Installer XML (WiX), including Windows applications and services. The book then takes you through practices for developing with WCF and Web Service.

The software development lifecycle is completed with practices on testing, such as project structure, naming, and the different types of automated tests. Topics such as test coverage, continuous testing and deployment, and mocking are included. Although this book uses Visual Studio as an example, you can use these practices with any IDE.

What this book covers

Chapter 1, Working with Best Practices, discusses several motivating factors about why we might want to use "recommended practices" and why we’re sometimes forced to resort to "recommended practices" rather than figure it out.

Chapter 2, Source Code Control Practices, looks at source code control terminology, architectures, and usage practices.

Chapter 3, Low-level C# Practices, looks at some low-level, language-specific practices. Topics like generics, lambdas, iterator members, extension methods, and exception handling will be detailed.

Chapter 4, Architectural Practices, looks at some architecture-specific practices. These practices will include things such as decoupling, data-centric applications, and a brief look at some recommendations for distributed architectures.

Chapter 5, Recommended Practices for Deployment, discusses installation technologies and covers some of the more common features required by the majority application installations. The chapter focuses mainly on deployment of applications through Windows Installer

Chapter 6, Automated Testing Practices, covers automated testing practices. Practices regarding test naming and structure, coverage, mocking, and types of tests will be covered.

Chapter 7, Optimizing Visual Studio, discusses ways of making Visual Studio operate more efficiently, work to our advantage, and ways to make working with Visual Studio friendlier.

Chapter 8, Parallelization Practices, discusses techniques such as threading, distributed architecture, and thread synchronization. Technologies such as Task Parallel Library, Asynchronous CTP, and asynchronous additions to C# 5.0 and Visual Basic 10 are also covered.

Chapter 9, Distributed Applications, discusses ways of architecting distributed applications, as well as specific technologies that help communication of nodes within a distributed application. In addition, it covers ways of debugging, monitoring, and maintaining distributed applications.

Chapter 10, Web Service Recommended Practices, discusses web services. It covers practices with WCF services, ASMX services, implementing services, consuming services, and authentication and authorization.

What you need for this book

  • Visual Studio 2010 Express (Professional recommended) or better

  • Windows XP SP3 or better

  • Optional: NUnit or XUnit

Who this book is for

.NET developers using Visual Studio for programming will find this book useful. If you are developing your application with C#, you will find better ways to do things with Visual Studio.

You should know basics of development with the .NET Framework and will need working knowledge on Visual Studio.

Conventions

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: "The Iterator method returns IEnumerable that results in three DateTime values."

A block of code is set as follows:

public static IEnumerable<DateTime> Iterator()
{
Thread.Sleep(1000);
yield return DateTime.Now;
Thread.Sleep(1000);
yield return DateTime.Now;
Thread.Sleep(1000);
yield return DateTime.Now;
}

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

namespace ConsoleApplication
{

using Numerical;
internal class Program
{
private static void Main(string[] args)
{
var values = new int[] {1, 2, 3};
foreach (var v in values.Cubes())
{
Console.WriteLine(v);
}
}
}
}

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: "right-click on a project in Solution Explorer and select Unload Project."

Note

Warnings or important notes appear in a box like this.

Note

Tips and tricks appear like this.

Reader feedback

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 , and mention the book title through 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.

Customer support

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.

Downloading the example code

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.

Errata

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/support, 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 to our website, or added to any list of existing errata, under the Errata section of that title.

Piracy

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 with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.