Question

First off, if I build this project using MSBuild via the command line it works flawlessly.

What I've been able to determine is that the contentPath that is being generated for the source argument is tripping up TFS.

<Target Name="DeployRemote">
<Exec WorkingDirectory="$(MSDeployPath)" 
      Command="msdeploy.exe -verb:sync -      
      source:contentPath=&quot;$(MSBuildProjectDirectory)\bin\Debug\&quot;...
</Target>

TFS Errors:

 EXEC: FileOrFolderNotFound
 EXEC: Object of type 'contentPath' and path 
       'C:\a\src\MailChecker\MailChecker\bin\Debug\' cannot be created.
 EXEC: Could not find a part of the path '\\?
       \C:\a\src\MailChecker\MailChecker\bin\Debug\'.
 EXEC: 1.

Note: This target is called within MSBuild's post build target (which is initially commented out in your csproj file)

Could it be that TFS is using a different output directory than bin\Debug? I made sure that the output path in my proj file was bin\Debug..

Was it helpful?

Solution

@The Muffin Man

If that is your real name, here is the reason.

TFS outputs stuff into a common bin directory, in which all of your files will be dumped to, with exception of your websites. Which should be in a _PLublishedWebsites like directory.

You will need to configure TFS Build Workflow to dump the projects into separate build directories. I believe with newer versions of TFS this is easier, however it will require you to open and edit the TFS Workflow you are using to build your software.

This is a frustrating aspect of TFS Build because you will need to checkin the TFS workflow and run it to verify that has fixed the problem.

I found this

In TFS 2012 / .net 4.5 you can control this behaviour by passing an msbuild argument in your build definition /p:GenerateProjectSpecificOutputFolder=true

Stackoverflow answer

While i liked the whole notion of TFS i think the other more mature build servers (TEamCity, Go.cd, Jenkins) are really polished in this respect because they just use MSBUILD. So its very easy to test and tweak, because the result will be the same on the build server as it is on the individual developer machines. /rant.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top