why do i have to rebuild the test project, whenever i change the code?
I have visual studio 2010, and a unit-test project.
when i run (debug test in the current context),the开发者_StackOverflown stop it,and then change the code,i have to rebuild the project, otherwise the project will run without debugging, and it will use the old code !!!
why is that happening ?
Because the tests needs a compiled version of the code, since they need to execute your code to test whether it works or not.
Edit: in my environment, the test project is in the same solution. Running the test will automatically rebuild the project.
When you 'run' the code you are running a compiled executable. When you change the code this does not change the compiled executable (i.e. you have to 'rebuild' it).
精彩评论