I’ve never been a fan of deploying test dependencies using testrunconfig. I prefer dependencies to be located as closely as possible to where they are used, ideally on an individual unit test. Using testrunconfig means that the dependencies are deploy at the solution level.
Having dependencies attached to each unit test for my current project has become unmaintainable however as almost all unit tests require the same dependencies. This makes testrunconfig appropriate in this case.
The issue I found with deploying dependencies with testrunconfig is that the dependency is not deployed into the TestResults directory when a new dependency reference is added to the config. This appears to be a bug in Visual Studio where the testrunconfig contents is cached. The workaround is to reload the solution. Each time this happens I have actually closed the IDE and opened the solution again. When the test run is executed the dependencies are not deployed as expected.
Tags:
10f910b0-d1bf-4141-871f-012f70874e65|0|.0
Changing the namespace of a solution that has already progressed significantly down the development path can be a pain. Visual Studio doesn’t native support namespace refactoring and tools like ReSharper can get bogged down with a huge set of changes. There is usually a dirty result if either of these tools are used as the project and solution directories are not renamed. These need to be done manually in Source Code Explorer which then throws out the relative paths stored in the solution file.
Changing a namespace can be a messy job. In these circumstances it’s often best to hand craft an external solution to this problem. I’ve finally written that solution as a console app after doing this job the painful manual way too many times.
The attached file contains the console application code. There is no defensive code against exceptions so it’s best to run this in the IDE. There are three constants you need to update before running this. These are the root path, find text and replace text. The code records everything that happens out to the console and a log file that is unique for each run.
Program.cs (11.54 kb)
Tags: TFS, ReSharper
56b996cb-5af9-4d67-ae79-2b09801ffcdf|0|.0