I've been having a problem with some integration tests that I've been running that started only recently. At this point, I can run them once and have them successfully pass. However, if they run again, then they fail. The reason they fail is that they're looking for a connection string, and my error output tells me the connection string doesn't exist. When I debugged into the code, I would see that the only connection string was some default connection string, and the ConfigurationManager was showing me no app settings. Also, I could never debug into my test assembly when this was happening (although I could debug other assemblies). If I reload and rerun the test assembly, then everything works fine again.
After digging around, I finally see why all this is happening. When I reload and re-run the project, two separate workspace directories are created. The bin\debug directory for both has the assembly, config, and pdb. Whenever I right-click a test and select "Browse to workspace used for the selected test", I'm taken to the last created workspace directory. As the tests finish running, I see that the earlier directory remains unchanged. However, after the tests complete, all of the files except for the assembly itself are deleted from the later directory. I realized that the reason I can't debug is that the pdb file is deleted, and the reason for the ConfigurationManager problems is that my .config file is deleted.
I need to know why I'm having this problem, because it's getting really annoying.