msbuild - TFS build - "content" build type files not present in a unit test's \out folder? -


i have solution containing unit test project , various other projects (which unit tests references). 1 of these projects references assembly in turn depends on native interop dll, i've added project build action of "content", , "copy always".

i can build , run unit tests fine on pc, fail during tfs (2012) build. in can see interop dll in server's \build\...\bin\ folder, it's not in \build\...\tst\[test_name]\out\ folder.

i assume tfs trying clever copying thinks unit test's dependencies? i've tried adding interop dll unit test project (in same manner above), makes no difference. i've tried adding [deploymentitem] attribute 1 of unit tests (to copy interop dll), doesn't seem work.

i figured out, although wasn't obvious. default, tfs build creates 3 subfolders:- \bin, \src , \tst. latter test project , dependencies copied (to \out subfolder), interop dll won't copied isn't managed project dependency. this isn't problem on dev pc - when unit test project built, visual studio honours interop dll's "copy always" option (even though it's in different project), ensuring gets copied unit test project's \bin folder.

i tried [deploymentitem] attribute didn't have luck - there conflicting articles paths relative to, , seems have have .testsettings file present work. after spending long time checking-in , testing sorts of permutations, never had success this.

i tried deploying files using .testsettings file ("deployment" tab). complicate things, interop dll must reside in subfolder under \bin folder (it's sqlite.interop.dll, if interested). .testsettings deployment tab doesn't seem honour folder structure, interop dll copied \tst\out folder, rather required subfolder.

in end, able configure build run unit tests tfs server's \bin folder, works in comparable way dev pc:-

  1. create .testsettings file , add solution. in properties dialog, "deployment" tab, ticked "enable deployment" checkbox. don't specify files on tab.

  2. check file in tfs, edit build definition , set process -> automated tests -> test assembly -> run settings file accordingly.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -