MSTEST unit tests & deployment problems

Every now and again you might require for some additional resources to be present in order for your unit test to properly execute. This seems as a reasonable requirement, and MSTEST has indeed addressed it with what goes by the name "Deployment".

To configure deployment for your unit tests double click the "Local.testsettings" in your "Solution Items" folder, you should be able to see a "Deployment" option on the left side, allowing you to add files and folders to be copied alongside your unit tests. So far so good.

Then make sure these test settings are the active ones, i.e, currently being used by your solution's unit tests:

In an ideal world this is where this post would be ending, but ... it is far too often the case that you add a deployment item, be it a folder or a file, hit apply and run your unit test only to find out the items you've specified ARE NOT COPIED alongside your unit test (commonly referenced as "Deployment items not working").

Now, unless carefully handled, this may lead to a considerable amount of frustration building up inside of you, threatening your metal well being. Rather than turning to Prozac, you should instead restart your solution (As in close, then open. No need to restart the VS). Once the solution restarts, the deployment items should be in effect and the specified items should be copied, at last.



Popular posts from this blog

Eclipse vs. IntelliJ, an empirical rant

Sending out Storm metrics