BABA
BABA

Reputation: 287

Team Foundation Build Activitie "DownloadFiles" is giving error

I am customizing the default build process template in TFS 2010.

i am using "DownloadFiles" build activity and in server path i have given "$/TFS/Libraries/Foo.DLL", when i run the execute definition its throwing error as "Access to the path '\ServerName\SharedFolder\BuildName\TempFolder' is denied.".

But when i give server path as "$/TFS/Libraries" its downloading all the files in Libraries folder into shared TempFolder.

But i need do download only one file. Please help..

Thanks in advance..

Upvotes: 1

Views: 692

Answers (3)

Jonathan
Jonathan

Reputation: 7551

Now, DownloadFiles does work for a whole folder only:

  • ServerPath="$/proj/path" - works great, all is downloaded to LocalPath.
  • ServerPath="$/proj/path/name.ext" - borked.

I've de-compiled DownloadFiles to see why: First it gets a list of server items, in our case just $/proj/path/name.ext. Then, it calculates the local path like this:

localItemPath = Path.Combine(LocalPath,VersionControlPath.MakeRelative(ServerItem, ServerPath));

In this line, the activity assumes that ServerPath is a path. If it's not, then MakeRelative will not recognize it, and the local path will be LocalPath/$/proj/path/name.ext, as the OP has observed.

Also, if ServerPath is not canonical - for example, $/proj/path/../path2, the same will happen. Solution: use VersionControlPath.GetFullPath(myNonCanonicalPath).

Upvotes: 1

pantelif
pantelif

Reputation: 8544

There are two separate Build activities, DownloadFiles for a folder ServerItem and a DownloadFile for a single file ServerItem.
I'd expect it should work with DownloadFile.

Upvotes: 0

KMoraz
KMoraz

Reputation: 14164

You need to grant the user running the build service with write permissions on the shared folder.

http://msdn.microsoft.com/en-us/library/cc668757.aspx

Upvotes: 0

Related Questions