0

I'm working on Web site project which requires some Unit tests (for controllers, etc).

Solution:
WebPortal
WebPortal.Tests

Team Foundation Server is used for gated check in and build of the solution. Deployment is managed by Octopus. During the gated check in the following error occurs:

CSC: Metadata file 'D:\TFSBuilds...\Sources...\WebPortal\bin\WebPortal.dll' could not be found

In that destination only WebPortal.pdb file is generated, while the DLL is required by WebPortal.Tests project. The DLL in generated (int /bin) on localhost, however, so this error doesn't occur there. I have figured out, that TFS generates DLL in bin folder for Class Library type projects.

How could I fix that problem to be able to run unit tests on WebPortal while using gated check in?

  • it should generate that dll as part of the build, double check your build order and ensure that the build of the Test Project is the very last project to be built, as it maybe a timing issue – Just TFS Oct 01 '14 at 14:39
  • Test project is below WebPortal project in the build order. There are more projects in between, but all order seems to be ok. But what it weird, WebPortal project doesn't contain DLL in bin directory even if Test project is not involved. Can it be because of wrong incorrect Build Definition or incorrect Octopack script config? – Aurimas Šimkus Oct 02 '14 at 06:46

1 Answers1

1

You need to convert your Web Site to a Web Application.

You can create a new Web Application project separately and drop the file into the Website folder. Then add this new project to you solution and remove the website. Team build will now output all the required files.

  • It seems that I already have Web Application project, because it uses MVC and it is compiled into DLLs on localhost in BIN folder. However, BIN is empty on TFS while all DLLs are copied to Binaries folder. I tried to create new Web Application and it contains DLLs in BIN folder on TFS, however the problematic project is quite big and not new so it maybe consists some weir configurations. – Aurimas Šimkus Oct 03 '14 at 05:59
  • You should have a folder in the Drop folder called "_PublishedWebsites\[Sitename]\". is the bin folder in there empty? – MrHinsh - Martin Hinshelwood Oct 03 '14 at 15:38
  • Yes, I have such a folder in Binaries folder. I have discovered some new things. It seems, that projects, which has Octopack included are built in Binaries directory, while other projects are built in Sources directory in bin folder of the project. So the problem is that test project is also built in Sources folder and its build process searches for WebProject in Sources as well while it is in Binaries folder. – Aurimas Šimkus Oct 06 '14 at 06:40