0

我想设置最大工作项附件大小。从旧博客中,我发现可以通过调用SetMaxAttachmentSize,但这些博客适用于旧版本的 TFS。我找到了 TFS 2010 的新 Web 服务路径。

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

不幸的是,当我这样称呼它时,我收到了这个错误: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).

我不知道如何通过浏览器格式化调用以针对特定项目集合。有什么想法吗?

4

2 回答 2

1

显然,TFS 2010 上没有利用 SetMaxAttachmentSize Web 服务,因此您需要以编程方式执行此操作,请尝试运行以下代码:

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 });

我希望这个对你有用

问候, 兰德尔·罗萨莱斯

于 2010-06-01T23:43:25.557 回答
0

我发现这行得通。它比编写代码更容易。

  1. 转到此 url 替换<Collection>为您的项目集合:http://localhost:8080/tfs/<Collection>/WorkItemTracking/v1.0/ConfigurationSettingsService.asmx
  2. 选择SetMaxAttachmentSize

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

于 2012-10-19T14:08:40.250 回答