How can I add an attachment via the SDK to a work item without using a physical file?

I am trying to create a new work item for TFS 2010 through 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 that the file be attached to be placed on any network-accessible path or on disk in the TFS server itself.

In our case, the attached file is just a block of memory, and saving attachments to the physical path seems unnecessary and definitely complicates the deployment steps required by our clients, since we must place them in the file system and then delete them after creating the work item.

Is there a way to mount a file without having to put it on the file system - ideally, I think, just providing a byte array, file name and mime type?


, - , , :

http://witcustomcontrols.codeplex.com/SourceControl/changeset/view/74794#336044

+3

Source: https://habr.com/ru/post/1760211/


All Articles