1
votes

I'm trying to get a SharePoint 2010 web portal working for a TFS 2012 team project. Most of the functionality is working, but I'm having a difficult time getting the custom work item controls we've built working in the SharePoint Project Portal site. (They're working fine within Visual Studio, we haven't tried getting them working in the default TFS Web Access portal.)

My questions are:

Since the TFS Web Access method for creating custom properties have been updated, is that method appropriate for the SharePoint site? (I doubt it, since jQuery is necessary and isn't included by default in SP 2010, but I thought I'd ask.)

Whenever I try to test this, all I get is "Error: Unable to create 'FieldName'" with nothing in the ULS logs. Is there any way I can debug this?

Are there any examples available online that I may have missed in my searches?

1

1 Answers

0
votes

After a lot of digging and frustration, I have finally gotten a simple control working. Indeed, SharePoint 2010 expects the custom controls to be formatted similarly to Web Access 2010, not Web Access 2012. Here is an example that helped:

http://code.msdn.microsoft.com/windowsdesktop/CSTFSWebAccessWorkItemMulti-ace1b01e

Also, if you install the 2008 Team System Web Access (yes, 2008), you'll get a Word document with some helpful documentation.

Here are some caveats:

The Word documentation states that the control needs to inherit from both IWorkItemControl and IWorkItemWebControl. Since IWorkItemWebControl contains all of the fields that IWorkItemControl does, and IWorkItemControl is declared in a DLL that references .NET 4.5 (not good for SharePoint 2010), I referenced only IWorkItemWebControl and it seems to work.

The documentation states that your control needs to inherit from System.Web.UI.Control to work, but the UserControl doesn't work. I had to inherit from one of the WebControls to get it to work.

The custom controls need references to TFS 2012 versions of several DLLs (which are listed in the sample download), but the only place I found them were in the GAC on the SharePoint server. So I copied them from the GAC onto my local machine for development.

Deploying is easy - all you need to do is place the .wicc file and the DLL into "Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\Tswa\CustomControls".

If I find anything else, I'll post it here.