tags:

views:

109

answers:

1

I want to set the maximum work item attachment size. From old blogs I have found that it is possible by calling SetMaxAttachmentSize, but the blogs are for older versions of TFS. I have found the new webservice path for TFS 2010.

http://localhost:8080/tfs/_tfs_resources/WorkItemTracking/v1.0/ConfigurationSettingsService.asmx/SetMaxAttachmentSize

Unfortunately when I call it like that I receive this error: This request can only be made against a project collection. The (.asmx) file should be located in the project directory (usually _tfs_resources under the application root).

I don't know how to format the call via a browser to target a specific project collection. Any thoughts?

+1  A: 

Hi Jon,

Apparently SetMaxAttachmentSize web service was not leveraged on TFS 2010 therefore you need to do this programmatically, try running the following code:

TeamFoundationServer tfs = TeamFoundationServerFactory.GetServer(@"http://yourtfsserver:8080/tfs/DefaultCollection"); ITeamFoundationRegistry rw = tfs.GetService(); RegistryEntryCollection rc = rw.ReadEntries(@"/Service/WorkItemTracking/Settings/MaxAttachmentSize"); RegistryEntry re = new RegistryEntry(@"/Service/WorkItemTracking/Settings/MaxAttachmentSize", "20971520"); //20MB if (rc.Count != 0) { re = rc.First(); re.Value = "20971520"; } rw.WriteEntries(new List() { re });

I hope it works for you

Regards, Randall Rosales

Randall Rosales