Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / DevOps / TFS

How to Change TFS 2010 Attachment Size

5.00/5 (1 vote)
21 Jul 2011Ms-PL 11.7K  
A post on how to change attachment size in TFS 2008.

Here is a post from 2008 on how to change attachment size in TFS 2008, the same concept is available in 2010 but there is a small confusion about 2010.

Many people had problems changing the attachment size in TFS 2010 using the same web service because of the following error: 500 Internal Server Error

image

There were people who changed the attachment size using code:

C#
TeamFoundationServer tfs = TeamFoundationServerFactory.GetServer(
    @"yourtfsserver/.../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 });

But the only thing you had to do in order to change the attachment size in TFS 2010 is to change _tfs_resources to the collection name, as follows:

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

to:

http://localhost:8080/tfs/<CollectionName>/WorkItemTracking/v1.0/ConfigurationSettingsService.asmx?op=SetMaxAttachmentSize

Enjoy!

License

This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)