This project is read-only.

Problem with PrepareToPublish

Aug 17, 2009 at 2:19 PM

I'm trying to incorporate NUnit for team Build, but get this error:

Transforming NUnit output...
  Loading XSLT from e:\BuildSourceArea\ElvizETRM\CI Ophelia ECS Release\BuildType\NUnitToMSTest.xslt
  Loading NUnit Output from e:\BuildSourceArea\ElvizETRM\nunit_results.xml
  System.InvalidOperationException: PrepareToPublish failed: Publish_ResultDirectoryCreateFailed
     at KWatkins.NUnitTfs.Publisher.PrepareToPublish(String buildId, Guid runId, Boolean overwrite) in C:\Users\Kevin Watkins\Desktop\NUnitTFS\NUnitTFS\Publisher.cs:line 76
     at KWatkins.NUnitTfs.Publisher.Publish() in C:\Users\Kevin Watkins\Desktop\NUnitTFS\NUnitTFS\Publisher.cs:line 45
     at KWatkins.NUnitTfs.Program.Main(String[] args) in C:\Users\Kevin Watkins\Desktop\NUnitTFS\NUnitTFS\Program.cs:line 19
e:\BuildSourceArea\ElvizETRM\CI Ophelia ECS Release\BuildType\TFSBuild.proj(269,5): error MSB3073: The command ""e:\BuildSourceArea\ElvizETRM\CI Ophelia ECS Release\BuildType\NUnitTFS.exe" -n "e:\BuildSourceArea\ElvizETRM\nunit_results.xml" -t "ElvizETRM" -b "CI Ophelia ECS Release_20090817.14" -f "Debug" -p "Any CPU" -x "e:\BuildSourceArea\ElvizETRM\CI Ophelia ECS Release\BuildType\NUnitToMSTest.xslt"" exited with code 1.

I've searched high and low for what Publish_ResultDirectoryCreateFailed can mean, and what directory it is talking about, but I am unable to find any clue.

Aug 20, 2009 at 10:54 PM
Edited Oct 16, 2009 at 3:45 AM

It looks like a permissions problem on the drop share.  Can you check both the build account and the TFS Service account have full permissions to the drop folder?  Failing in PrepareToPublish is probably an indication that it's the TFS Service that is missing the permissions.

Dec 16, 2009 at 9:58 PM
Edited Dec 16, 2009 at 10:05 PM

Hi, it's been a while since this was posted but I wonder if you managed to resolve the issue?

I am having the same problem, and the permissions seem to be OK. The build is running/publishing fine without this extra step. I have also tried running the full command line as an administrator an get the same error message. 

I would be very grateful for some more clues as well; I might try running NUnit4TeamBuild in debug mode to see if I can get any more details.



Dec 17, 2009 at 10:04 AM

I doubt you'll get any more information running in debug mode; the error you've given is returned by TFS. And errors returned by TFS aren't very useful... Having said that you might be able to put a breakpoint on the line where it throws the InvalidOperationException and inspect the error object returned by TFS.

Anyways if memory serves then TFS will attempt to create a folder on the build machine inside your working directory to put the result; I presume it's this step that is failing. Which implies that the TFS Service account (not the account the build service is running under, or the admin account on the build server) doesn't have permission to do that. An easy way to confirm that would be to temporarily give the Everyone group full access to the folder in question on your build server and see what happens.

Dec 18, 2009 at 4:04 AM

Thanks for your help!

Trying to give everyone access helped narrowing down the problem: the TFS drops folder was also setup as a shared folder, which overrode the  security settings.
Everything works perfectly now.