I'm looking at creating new work items for TFS 2010 via the client SDK.
In the SDK you can do something like this:
WorkItem item = ...;
item.Attachments.Add(new Attachment("c:\\path\\on\\tfs\\server\\shot.png", "Screen shot"));
item.Save();
But this requires the file being attached to be placed on either a network accessible path, or on a disk in the TFS server itself.
In our case the file being attached is just an in-memory blob, and having to save attachments to a phsyical path seems unecessary and definitely complicates the deployment steps required by our customers, as we need to put them on the file system, and then subsequently remove them once the work item has been created.
Is there any way to attach a file without having to place it on the file system - ideally I'm thinking of say just providing a byte array, file name and mime type?
Update
Appears the consensus is that this is not possible - at the work around is to write your own attachment class, that wraps up the functionality to create a temporary attachment file on disk:
http://witcustomcontrols.codeplex.com/SourceControl/changeset/view/74794#336044