0

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?

2 Answers 2

1

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<ITeamFoundationRegistry>(); 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<RegistryEntry>() { re }); 

I hope it works for you

Regards, Randall Rosales

Sign up to request clarification or add additional context in comments.

Comments

0

I have found that this works. It is easier than writing code.

  1. Go to this url replacing <Collection> with your project collection: http://localhost:8080/tfs/<Collection>/WorkItemTracking/v1.0/ConfigurationSettingsService.asmx
  2. Choose SetMaxAttachmentSize

You can test to make sure you set it correctly by going to the same url above and then selecting GetMaxAttachmentSize.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.