开发者

With the TFS SDK, can I register custom metadata in the server?

开发者 https://www.devze.com 2023-02-16 11:00 出处:网络
I have a custom, windows service that a visual studio plugin connects to and Visual studio connects to a Team System server.开发者_如何学JAVA

I have a custom, windows service that a visual studio plugin connects to and Visual studio connects to a Team System server.开发者_如何学JAVA

Is there anyway for my custom service to somehow register it's uri in the TFS Server so that the visual studio plugin can retrieve the uri from TFS and know how to connect to the service?

Mainly, I want to prevent the user of the plugin from having to configure the custom service's uri since I know they will always be connecting to a tfs server (the windows service also connects to the same TFS server, so you won't be using the service and plugin without the same instance of TFS).


Team Foundation Server 2010 has a registry service (not the Windows Registry) that would be suitable for this purpose. Registry settings can be set at the instance, collection and user levels.

For your needs, if your service is common to the whole TFS server, then setting an instance-level registry setting is probably the best choice. Otherwise, setting it at the collection-level would be the next choice.

Each setting in the registry is a Key + Value pair. The key is hierarchical (like a file path), and the value is a simple string value. For example, /Service/Integration/Settings/NotificationJobDelay = 120

You can use the TFS Client Object Model ITeamFoundationRegistry to add your own setting, or use tfsreg.exe from Neno, or this powershell script. Remember, your plugin will also need to reference the TFS Client Object Model to retrieve the value.

Example:
tfsreg.exe /server:http://yourtfs:8080/tfs /path:/Configuration/YourServiceName/Uri /value:http://yourservice/service.svc
0

精彩评论

暂无评论...
验证码 换一张
取 消