I was recently having issues with CodeLens not showing all the data in Visual Studio 2017. Thanks to Rosen Dash and the TFS team at Microsoft I was able to get my issue resolved. Here’s the problem, and solution, I was having for others that may be experiencing the same issue.
Upgrading from MSTest to MSTest v2
MSTest v2 is the new version of the MSTest framework that has been shipping with Visual Studio for years. Unlike the previous version, the new version is a set of NuGet packages that do not have a dependency on the version of Visual Studio installed. This article will discuss the process of upgrading from the “old” version to v2.
Migrating to Package References
One of the better changes in Visual Studio 2017 is the moving of the NuGet packages out of packages.config and into the project file via package references. Unfortunately all the documentation that I’ve seen seems to assume that this is a new project or at least one that was created in Visual Studio 2017. In my experience this is unlikely to be true. This article will discuss the steps I use to migrate an older project to using package references.
Creating Item Templates in Visual Studio 2017
Many times when you are adding a new item to a project you probably find yourself changing the generated item to line up with your coding or company styles. Often this includes a copyright, perhaps the ordering of members in a type or even completely replacing the item with something else, like an enum. Visual Studio is designed to be extensible. Item templates allow you to create your own templates and have them available in VS so you don’t have to keep making the same changes over and over again. In VS 2017 templates are even easier to create than before. I will discuss how easy it is to add new templates in this article.
Writing a Context Provider for CodeRush for Roslyn
Several years ago I wrote an article about creating a custom context provider for CodeRush. In that time CodeRush Classic, as it is called, has been replaced by CodeRush for Roslyn which relies on Roslyn. Now seems like a good time to update the provider. Rather than having to read both articles I’m going to repost the old article with updated changes for Roslyn. The code is semantically similar but had to be rewritten to use Roslyn.
Updated Visual Studio Templates for VS 2017
Now that VS 2017 is ready it is time to update the template extensions I provided for previous Visual Studio versions. However this time the templates themselves don’t really need to change. Instead the VS extension that I wrote to wrap them needs to be updated to take advantage of the newer VS extension features.
Custom Naming Styles in Visual Studio 2017
One of the great new features in Visual Studio 2017 is the ability to define naming rules for code and then let the IDE notify you when they are violated. Depending upon what options you choose the IDE can suggestion, warn or flat out fail compilation because of violations. In this release the options are limited but since the rules are using Roslyn, the options can only improve in later releases.
Identifying Slowdown in Visual Studio 15 Preview 5
As Visual Studio has become more extensible there are more and more extensions that developers like to install. Unfortunately not all of them are well behaved. The more extensions you install the more likely VS will crash or slow down. When this happens most people tend to go to the forums and complain about VS bugs and/or performance. Yet the culprit is likely an extension. Up until VS 15 preview 5 there has been no easy way to diagnose this. Generally, when responding to a forum post, a user is recommended to run in safe mode to eliminate the chance that it is an extension. But doing this doesn’t really help narrow down the problem that much because: 1) the problem may not occur very often and 2) many extensions are critical to doing real development.
In VS 15 Microsoft has finally added some performance monitoring to VS. VS has had perf monitoring for a while but none of that was visible to the average user. In VS 15 you can now go to Help\Manage Visual Studio Performance and get a window that provides some basic information about extensions and tool windows, the two most likely causes of a slowdown. This window allows you to see if an extension or window is slowing things down. If so then you can disable it and report the issue to the author. Hopefully this will cut down on forum posts but we’ll have to see how this feature evolves until release.