开发者

why do i have to rebuild the test project, whenever i change the code?

开发者 https://www.devze.com 2023-01-21 16:07 出处:网络
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 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).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号