BM-Bloggers

The blogs of Black Marble staff

Presenting at the first meeting of the Peterborough VBug group

I enjoyed presenting on TFS at the inaugural meeting of the Peterborough VBug group last night. Thanks to Jyoti Majithia (VBug regional administrator) and Andy Westgarth (VBug chairman) for organising it. Hopefully this will be the start of another thriving user group community.

If anyone wants a copy of the slide stack, there were no major changes between the one I used last night and the DDD5 one our main web site. There is also a screencast of demo of eScrum in the same archive.

I was asked a couple of questions that I could not fully answer off the top of my head:

  • If you have a Novell NDS based LAN how can you install TFS? The answer is TFS does not support NDS or LDAP for authentication. Also you cannot do a Dual Server TFS install as this requires an Active Directory. However a Single Server install will work if all the PCs (clients and servers) are in a Windows Workgroup (as well as the NDS domain).
  • Can I access TFS from inside the Microsoft Expression products or Macromedia products such as Dreamweaver ? For Microsoft Expression the answer is strangely no - this seems a big oversight. User would have to check files out via Team explorer then load Expressions. There is the MSSCCI add-in to allow third party tools to connect to TFS, but this does  not appear to work with DreamWeaver as it has its own means of connection to source control such as VSS.

Accessing User Profile Information in WSS 3.0

MOSS and WSS 3.0 handle user profiles differently. In MOSS, user profile information is stored centrally and can be shared across site collections. Profiles can be manipulated using the UserProfileManager class found in Microsoft.Office.Server.dll.

Life just isn't the same when working with WSS 3.0. When developing a workflow, for example, it may be useful to access a property of the user profile. You can't use UserProfileManager as it doesn't exist and SPUser doesn't expose most of the profile information. In WSS 3.0 the user profile information is stored in a hidden list specific to an individual site collection. If you have multiple site collections, a different hidden list is used for each site collection. The User Profile Information is just another list and can be treated as such -

SPList userProfileList = web.Lists["User Information List"];

foreach (SPListItem user in userProfileList.Items)
{
    Console.WriteLine(user["Name"] + " " + user["Department"];
}

The cut down C# above lists all the user names and departments.

Accessing the user profile information in WSS 3.0 is straightforward, once you know how ;-)

Lego Turns 50

One of the most important toys of our time has turned 50 , I am a huge fan of learning and development tools and Lego is one of the greatest out there. There isn't a Christmas or Birthday that I don't provide the mandatory educational ;) set of Lego to some random child/niece/nephew or developer.

GizModo has a cool timeline ( I had the Galaxy Explorer , the car and the train when I was younger. The Mindstorms NXTis sat on my desk :) ) of Lego's history.

Its nice to see that Google have put a Lego logo up for the day (see the poster for why)

I still don't get Bionicle, but who cares when the Indiana Jones sets are coming out.

b.

Technorati tags:

Granting permissions on the GAC

Normally you don't encounter permission errors when installing to the global assembly cache (GAC). Today I did, even though I was logged on as a member of the administrators group (not that being an administrator is a guarantee of much).

If you navigate using Windows Explorer to %windir%\assembly, what you see is the view displayed by the assembly cache viewer. If you go up a folder and right click the assembly folder and click properties you won't see the security tab you normally see. The assembly cache viewer (Shfusion.dll) is a Windows shell extension that affects how Windows Explorer lets you view the folder.

You have two options at this point -

1. Alter the behaviour of Windows Explorer with regard to the GAC. Hannes Pavelka gives a nice post on how to do this. 

2. Open a command window and use Cacls. Cacls allows you to both view and alter the permissions on any folder, and subfolders, for any account, including the GAC, as long as you are running it as an account that has permission to do so. Sounds like a russian doll of permissions, doesn't it?

I chose option 2 as I don't like altering the expected behaviour. This can cause confusion further down the line.

In order to get round the installation issue I ran the following at a command window -

CACLS %WINDIR%\assembly /e /t /p administrators:W

this gave members of the administrators builtin group write permissions on the GAC, and the subfolders, and sorted out the installation issues.

SharePoint User Group - Newcastle

Big thank you to Penny Coventry and Steve Smith for presenting at the SharePoint User Group UK Newcastle meeting on Wednesday night. Both were excellent sessions.

Penny gave an overview of SharePoint Designer, which if not already, will probably become your default tool for design and basic development of SharePoint sites.

Steve covered Forefront Security for SharePoint. There are not too many choices when it comes to anti-virus solutions for SharePoint. Some vendors have had a less than successful record in this area and Forefront looks like a very interesting solution. Forefront offers real time and manual, multi engine scanning, as well as keyword content filtering.

Fun upgrading from Visual Studio TFS 2008 Beta2 to RTM

A while ago I made the classic mistake of installing the Beta2 of TFS on our live servers after seeing posts that it was reliable enough for production use. I had stupidly assumed that there would be an upgrade path to the RTM; there usually is from the last beta, but not this time.

TIP: Don't ever do this yourself, only use beta's in places you can throw them away without any issues.

So to fix this problem you have to remove the beta before you can install the RTM. We run a dual server configuration with the application tier on a VPC so I backed up the TFS DBs on our central SQL server, made a copy of the VPC and enabled the undo disk. I then tried to remove the beta 2, and it failed with a message DepCheck indicates Microsoft Visual Studio 2008 Team Foundation Server Beta 2 - ENU is not installed.

I had a search and found some similar reference to the error in http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2048187&SiteID=1 that suggest running

"C:\Program Files\Microsoft Visual Studio 2008 Team Foundation Server\Microsoft Visual Studio 2008 Team Foundation Server Beta 2 - ENU\GetCurrentTfsProperties.exe" "%TEMP%\TfsProperties.ini" "Config"

Which as expected reported it could not find all the properties required.

So I had a problem, I could not de-install the old version to put the new one on. But then I got to thinking - I am trying to get this server back to a clean empty state - why not just create a new one? Just like a disaster recovery situation.

So I...

  • Built a new server and added to our domain.
  • I install WSS3 manually so that I could set the DB location to our dedicated SQL server.
  • I installed SQL reporting services and patched it, again pointing it to our SQL server.
  • I then ran the TFS 2008 installer, giving it the location of our DB server, as if just adding a new application tier.

The problems then started. I got a TF220065 RS WMI RPC Server is unavailable error - which sounds like a reporting server install problem (which it is I suppose). When you check the logs it turns out the installer has looked on the db tier for the URL of the AT reporting services location. The db still thought I was using the old AT server, so was getting an error the old server could not be found (because it was off). You can this fix by hand by editing the entry in the tfsintergration.tbl_service_interface table on the DB server. Once this is done the install runs OK until you get TF53007 & TF50801 errors. I guess there is a manual fix for this, but the better solution is to use the proper tool for registering the new server name, which fixes the follow-up errors as well. You can run this from the old TFS AT server, or I guess any PC.

TfsAdminUtil activateAT <New AT COMPUTERNAME>

Once this was run the setup ran to completion.

Now this meant I had a new AT pointing at our old DBs, so I could see all our old team projects, I could access work items,reports and source control. However, for each team project I could not access the site portals or document repositories, but I expected this as I had recreated the whole of the WSS system with a new content DB. This was not an issue for us as we had chosen to use our main company MOSS 2007 system for documents, not the WSS install within TFS (the main reason for this choice being for TFS2005 the portal was a WSS2.0 install and we had already moved to SP2007).

If you want to recreate the TFS portal sites go into the WSS Central Admin and create a site with the right name e.g. http://mysserver/site/project1 and an appropriate template. You then have to give the new site appropriate user rights and all will be OK i.e. you can see the portal and documents from within team explorer. Of course you could also restore a backup of your old install if you had important data.

So I was quite pleased with myself by this point, I had worked all this out by myself. I thought it was all working until I tried to create a new Team project, this failed at creating the SharePoint site point of the wizard. It failed irrespective of the template chosen. The error on the wizard dialog was TF30217 but checking the detailed log it showed the real error was

TF30267: Exception: System.Web.Services.Protocols.SoapException: Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.Event Description: TF30162: Task "SharePointPortal" from Group "Portal" failed
Exception Type: Microsoft.TeamFoundation.Client.PcwException
Exception Message: The Project Creation Wizard encountered an error while uploading documents to the Windows SharePoint Services server on [my server]
Exception Details: The Project Creation Wizard encountered a problem while uploading documents to the Windows SharePoint Services server on [my server]. The reason for the failure cannot be determined at this time. Because the operation failed, the wizard was not able to finish

Now this proved to be a nightmare to fix involving many hours of fiddling and calls to Microsoft support. As with so many of this type of problem the fix was trivial when we spotted it. The problem turned out to be due to alternate access mappings in SharePoint. In effect when TFS creates a new site this is equivalent to the STSADM command

stsadm -o createsite -url https://<server>/sites/projectsite -ownerlogin DOMAIN\user -owneremail user@domain.com -sitetemplate _GLOBAL_#1

The key issue was if I used the url https://realservername/sites/projectsite it work, but if I use the full alias url (which I need so the correct SSL wildcard certificate can be used) e.g.  https://tfs.domain.co.uk/sites/projectsite it failed even though tfs is a cname alias for the host realservername on our DNS server. They should be equivalent.

Now I knew SharePoint/IIS needs to know about any extra names you give to servers. I had put an alternate access mapping in SharePoint to cover just this issue (via Central Admin, Operations), but I had made a mistake. I had added the alternate mapping as http://tfs.domain.co.uk - oops should have been https. Once this tiny change was made it leapt into life.

I have to say the error in the TFS create log were not that helpful, neither was the output of the new TFS Best Practice Analyzer. In the end it was found by creating many sites with STSADM.

I must say thanks to the persistence of Microsoft Developer Support in both India and the USA in getting this last issue sorted.

So now I have a fully working TFS 2008 install, I can start to have a look at the TFS to Project Server connector.