TESTTOOLSTASK warning VSP1024 Unable to open file file for writing.
August 7, 2008
This warning occurs when doing testing with MSTest and running the test under code coverage. It is related to the warning “warning VSP2013: Instrumenting this image requires it to run as a 32-bit process. The CLR header flags have been updated to reflect this.”
and has confused me a lot. Especially since, when running the tests in a build script, the warning seems to come and go.
No fear; the solution is quite simple (thanks to this excellent forum post); here is what you need to do:
- Find the test configuration file you’re using for the test run under code coverage. It is usually called LocalTestRun. testrunconfig and resides in the solution root.
- Open the file in a XML-editor
- Find all the CodeCoverageItem-elements change (or add) the attribute instrumentInPlace from “true” to “false”
- Save and rerun - works like a charm
But hey, I can hear some...