Use Roslyn to Write a Live Code Analyzer for string.format

One of the most important new features available in the next version of Microsoft Visual Studio 2015 is the new .NET Compiler Platform (codename “Roslyn”). The compilers are available via the traditional command-line programs but also as APIs natively available from within .NET code. It is exposes modules for syntactic analysis of code, semantic analysis, dynamic compilation to CIL, and code emission. With Roslyn it is possible to create a custom Live Code Analyzer that analyzes the code while the user types. Consequently, the developer is informed through the typical squiggle below the piece of code where the problem occurred.

In this case, I have created a live code analyzer for the string.format statement that covers these use cases:

  • Checks the format string syntax
  • Validates the number of arguments passed in the string format

Continue reading

Visual Studio Debugger Visualizers for Kinect v2

During my first development tests with Kinect, I often wanted to view the frames received from the device in an image format. Microsoft Kinect V2 SDK provides Kinect Studio, which allows me to display, record, playback and debug through breakpoint the data received from the device, simplifying the development process. As I use a laptop very frequently, I find it irritating to have to leave the development environment. Consequently, I decided to make some Visual Studio Debugger Visualizers, in order to be able to directly view the frame, received form the device, in an image format in the Visual Studio IDE. Continue reading

MSTest and Kinect v2

A careful analysis of the imperfections in the code and of where it does not perfectly reflect the original design is an essential step in producing valid, functional software, which provides a high level of customer satisfaction.

In the world of .NET it is possible to perform many types of automatic tests using MSTest or alternative test frameworks, for example NUnit, but is there a way to develop and execute automatic tests for software that uses Microsoft Kinect v2 technology? Continue reading