Is it possible to get VS 2010 to build before running tests
I have a Class Library project in Visual Studio 2010 that I want to test. I have created a seperate Test project in the same solution to test it. The Test project references the Class Library project. I created some tests ran them and they failed which was expected. However when I fixed the Class Library and ran the tests again it still failed. This was because the Class Libary project had not been rebuilt.
Is there some way to get Visual Studio 2010 to automatically build the Test project and all its dependancies before running the tests?
EDIT:
Some things I have checked:
- I've checked the reference is a project reference.开发者_如何学Python
- I've checked the Test project is last in the build order.
Still no joy. In case it makes any difference I am running the tests using the "Run All Tests in Solution (Ctrl+R, A)" button on the tool bar.
Right click on your test project, select Project Build Order and set your class library project to build before your test project, this should works ;-)
Ok, Here is what I did to fix this:
- Select the Test->Edit Test Settings->Local menu item.
- In the resulting dialog select Deployment.
- Check the 'Enable deployment' setting.
- Apply and Close the dialog.
精彩评论