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.
VSHost Bug is Squashed
Way back in Visual Studio 2005 Microsoft added a new debugger host, VSHost. The purpose, as advertised, was to speed up debugging by taking the hit for starting a debug session. The idea was that the host was started when you first began debugging and continued to run until you closed VS. This allowed VS to keep debugging information cached which sped up repeated runs of the debugging session. It only worked for managed applications but, for the time, greatly increased debugging startup. But there were problems with this approach. Firstly was that some apps simply didn’t work correctly with it. Microsoft provided a project debug setting that allowed you to disable the host in this case. Secondly it mucked with the whole debug process because VS started the host which emulated your process (it even had a config that matched your config). Thirdly, since it was a separate process, it would occasionally stop responding or crash which caused issues with the debugger.
Starting with VS 15 preview 5, the VS host process is gone. Microsoft has wisely optimized debugging startup times making the need for this process mute. So now running your app in the debugger is going to behave more naturally and, in theory, VS shouldn’t run into any more issues of disconnected processes. You can read more about this decision here.here
Light Switch Is Off (Deprecated)
As part of the Visual Studio 15 preview 5 release, Microsoft has announced that Lightswitch is officially deprecated. VS 15 will not ship with it. Microsoft is recommending that everyone switch to PowerApp or equivalent. Note however that Microsoft will continue to provide security fixes and support existing Lightswitch apps for the foreseeable future. However Microsoft does not recommend any new development use Lightswitch. Read the full announcement here.here