Book Image

Visual Studio 2015 Cookbook - Second Edition

By : Jeff Martin
Book Image

Visual Studio 2015 Cookbook - Second Edition

By: Jeff Martin

Overview of this book

Visual Studio 2015 is the premier tool for developers targeting the Microsoft platform. Learning how to effectively use this technology can enhance your productivity while simplifying your most common tasks, allowing you more time to focus on your project. Visual Studio 2015 is packed with improvements that increase productivity, and this book walks you through each one in succession to help you smooth your workflow and get more accomplished. From customization and the interface to code snippets and debugging, the Visual Studio upgrade expands your options — and this book is your fast-track guide to getting on board quickly. Visual Studio 2015 Cookbook will introduce you to all the new areas of Visual Studio and how they can quickly be put to use to improve your everyday development tasks. With this book, you will learn not only what VS2015 offers, but what it takes to put it to work for your projects.
Table of Contents (17 chapters)
Visual Studio 2015 Cookbook Second Edition
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Using a custom ruleset


The built-in rulesets that come with Visual Studio cover a variety of usage scenarios, and provide a way to use the Code Analysis tool in your projects immediately. They are also of great value when exploring an unfamiliar code base, as you can take advantage of the static analysis tools to identify areas where code should be rewritten to meet your in-house standards. All this means that the existing default rules may need to be customized depending on the needs and complexity of your project as this recipe will demonstrate.

Getting ready

We are going to continue with the project we created in the Analyzing your C++ code recipe. You will need VS2015 Community or higher in order to modify rulesets.

How to do it…

To use a custom ruleset, perform the following steps:

  1. Open the project created in the previous recipe.

  2. Open the AnalyzeThis.cpp file, and add the following highlighted code:

    # include "AnalyzeThis.h"
    int x = 0;
    
  3. Right-click on the project (not solution) in Solution...