The Visual Studio editor has lots of functionalities, many of them available with the use of shortcuts. In this post, I will share several that I find very useful and I use quite often. This post refers to Visual Studio 2019.
Some time ago I published a Visual Studio extension called Memeful Comments for displaying images, including animated GIFs, alongside your code to enhance explanations with visuals or simply to express your reaction to the code. This extension is now available for Visual Studio 2019!
Although this feature is available for years in Visual Studio, I only recently discovered this gem that allows rapid generation of C# classes from either JSON or XML.
Here is how it works:
- Copy the JSON or XML code to the clipboard.
- In Visual Studio, go to Edit > Past Special and chose either Paste JSON as classes or Paste XML as classes.
Unit testing is usually used for testing public types and members. However, there are cases when you might need to test types or members that are not public. These could be internal classes or private helper methods, for instance. Whether that is proper unit testing or beyond its scope is not a discussion that I want to get into here. However, in this post, I will show how you can unit test non-public types and members from .NET assemblies.
When faced with the need for testing non-public types and members you can use several approaches:
- change the accessibility to public; you can do that perhaps only for debug builds and keep the intended accessibility in release builds by using conditional compilation.
- provide public members of a class that invoke private ones;
- use reflection.
The first solutions involve changing the API only for the sake of the testing. The last solution avoids that but requires more work. To help with that, the Visual Studio unit testing framework provides some helper types that enable you to focus on the actual testing and be less concerned about the reflection details.
A couple of weeks ago, version 15.8 of Visual Studio 2017 was finally released. You can read here about the new things available in this version. In this post, I will discuss five productivity features available for C++ development.
The tools I use the most as a developer include the command prompt, notepad, Visual Studio, and Total Commander. The trouble is, I don’t really like the default colors they come with. However, some of them can be customized with different color schemes. Some very popular color schemes are Solarized and OneHalf, both having a light and a dark version. In this article, I will show how to enable Solarized for them.
It’s said that a picture is worth a thousand words. An animated GIF is probably worth even more. I have always wanted to show my reaction to code with pictures. Being able to display images along source code could have a lot of benefits beyond that. By inserting images within code we could better explain…
Matt Godbolt has announced today that the Visual C++ compiler is finally available on Compiler Explorer (https://godbolt.org/). Compiler Explorer is a website where you can write C/C++/Rust/Go/D code, compile it with various compilers and settings and see the resulted assembly code. #CompilerExplorer now has VS 2017 compilers! Huge thanks to @Microsoft and @apardoe! — Matt…
Visual Studio 2017 Enterprise provides a feature called Live Unit Testing that enables developers to see live how changing C# and VB.NET code affects its corresponding unit tests. Among its features, it includes showing coverage information in the editor as you type, integration with the Test Explorer, including/excluding targeted test methods or projects for large…
Visual Studio 2017 has been officially launched today. The release notes contain a summary of all the changes available in the new version. This post is focused on the changes for C++ development. The Visual C++ team has released a series of blog posts to document some of the new features. Here is a list…