How to resolve cases of Visual Studio “No tests appearing”
The Visual Studio Test Explorer can be a bit picky about showing tests. There are multiple reasons for why they don’t always show up when you expect them to do, and most of the cases are PEBKAC type of issues. That doesn’t mean it is easy, there are just becoming too many variations, and Visual Studio does not tell you what is really wrong.
The different variations of targets and adapters doesn’t make this easier. To help in diagnosing this, I have created the diagnostic flow chart shown below. Further below you will find the comments for each block and how to rectify the issues, if you don’t already know. The flowchart is mostly general, although I use NUnit as the default adapter in the examples.
IFIX: Create Solution Skeleton File
Download: IFix 1.7
When I start creating a new solution I normally want this in its own git repository, and I catch myself adding the same stuff over and over again. And, I often get the folder structures wrong, I seem to never get the hang of when and where Visual Studio creates a folder for the solution, why the solution ends up at the same place as the first csproj file, and I often end up moving things around to get it the way I want it.
Fixing up Visual Studio’s gitignore , using IFix
Updated 3.July 2014: Corrected pattern for NuGet, details in this blogpost. (IFix is in progress to be updated too, version 1.1 will have these fixes)
Is there anything wrong with the built-in Visual Studio gitignore ????
Yes, there is !
First, some background:
When you set up a git repo, it should be small and not contain anything not really needed. One thing you should not have in your git repo is binary files.
Converting projects to use Automatic NuGet restore, using IFix
In version 2.7 of NuGet automatic nuget restore was introduced, meaning you no longer need to distort your msbuild project files with nuget target information. Visual Studio and TFS 2013 build have this enabled by default.
However, if your project was created before this was introduced, and/or if you have used the “Enable NuGet Package Restore” afterwards, you now have a series of unwanted things in your projects, and a series of project files that have been modified – and – you no longer neither want nor need this ! You might also get into some unwanted issues due to these modifications. This is a MSBuild modification that was needed only before NuGet 2.7 !