0

I have a solution that has 4 projects in it. 3 are dependencies for my tests and the other is just my tests.

  • DL
  • BI
  • MySite (web site)
  • MyTests

Some unit tests in the MyTests project reference namespaces in the web site MySite for some MVC contollers.

Question is how do I get just the MyTests project to build and deploy with a TFS build. NO matter what I try the _publishedWebSites folder on the TFS build machine always has the web site and not the MyTests folder. For some reason it thinks it is building the web site and not the tests. Any help would be appreciated from the build definition or solution perspective.

The purpose is to build the tests and distribute them to a server where they can be run (selectively) using the command line tool in the task manager. I cannot distribute them if I cannot get the solution to build properly.

1 Answer 1

0

Alright so there are a few things. Firstly, you need to make sure that the outer solution recognizes MyTests as the start up project and has the other projects as build dependencies. However, this likely won't solve your problems. In order to do this you'll probably have to create a custom build script or edit your solution/project files by hand. The problem with the latter approach is that if other people are building MySite from this solution editing the project file to exclude it's output from the drop is going to cause problems for them.

My personal approach would be to make an MSBuild script which specifies the order in which to build the projects and which files you want in the drop. It's fairly straight forward and it will probably be easy to specify the output you want (this is sometimes very tedious if the projects build is messy to begin with or it has excessive and convoluted dependencies).

Here's the outer most resource for MSBuild. I'd look it over and think about what the simplest solution is but I wouldn't be surprised if you can just make every project build using their project files then add a single build step to cleanse your output.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.