But it works on my PC!

The random thoughts of Richard Fennell on technology and software development

Problem setting an email alert for the TFS 2010 Power Tools backup

One of the very useful features of the TFS 2010 Power Tools is that it provides a backup wizard, great for teams using TFS who don’t have much SQL/IT Pro experience. Whist setting this up on a server I hit an interesting gotta with sending alerts.

This TFS server in question was configured to enable SMTP alerting (via the TFS Administration Console)

image

and this was working

During the backup configuration wizard you have the option to be send email if the backup job fails. The SMTP details are picked up from the TFS servers SMTP alert settings. When I enter a TO: email address and pressed the test button I got an error

image

Turns out the error was at the SMTP server end. The SMTP was set to only relay emails from known user (those with a local mailbox). To allow TFS to send alert emails the MYDOMAIN\TFSSERVICE account, used by TFS as a service account, had had a mailbox created.

I had assumed (wrongly) that the TFS backup system relayed it alerts via the TFS alert system. It does not, though it does pickup the alert systems setting in the wizard. This means that the email is sent using the account the backup service is set to run as, not the one used by TFS.

So as soon as set my backup process as MYDOMAIN\TFSSERVICE (earlier in the wizard) the email test worked and so did the whole backup altering process.

TF80070 when loading a team query in MS Project

I create a number of task work items in TFS 2010 using a list in Excel. This all appeared to work OK, and I could run a work item query in Team Explorer and see all my new work items. However then I tried to open the work item query in Project I got a TF80070 error. It loaded the work items up a point in the list then failed and showed error dialog.

I altered the query to remove the work item that it had failed on and it loaded without issue. After looking at the offending work item in more detail I saw the Title field had a carriage return in it. This did not bother Excel or Team Explorer, but Project obviously hated it. Once I edited the title (in Team Explorer) to remove the carriage return everything was fine in Project.

So if you see a TF80070 error, it might be a Project/Team Explorer patching issue as forums suggest, but also check for invalid characters in query fields

Windows search not starting, making itself disabled on a reboot

Since I got my new laptop I have had a problem that the Windows Search services in Windows 7 keeps setting itself to be Disabled whenever I restart the the PC. I usually notice this when I try to do a search in Outlook and I have to press enter in the search box to start a search, it is not matching emails as soon as I start to type.

If I load the services control panel I can enable the Windows Search service and start it manually, restart Outlook and everything is as I expect, but all a bit of a pain to do. I checked the Windows event logs, and it said nothing about Windows Search apart from my manual starting of the service.

Seems the issue was that I had set the service’s start-up action to be Automatic – Delayed. When I set it Automatic then it seems to start Ok. All I can assume is that something else in the start-up process is not completing soon enough so the delayed start search search never bother to even try, but I surprised there is nothing in the log, but it is working now!

Where has my mouse cursor done? Unable to record a video in Microsoft Test Manager

MTM has the feature that you can use Expression Media Encoder 4 to record the test run as a video. To enable this feature, after you install MTM, you have to install the basic version of Expression Encoder, and a few patches see notes here for a list of files and the process.

I recently did this on PC and tried to record a video. As soon as the recording process started the PC virtually stopped. It ran to 50%+ load on a dual core 2.3GHz CPU and the mouse disappeared. As soon as I stopped MTM (via task manager and the keyboard alone) it became responsive again. If I ran MTM without a video recording it was fine. Should be noted that if I ran the Expression Encoder (not via MTM) I got the same problem.

Turns out the problem was not the PC performance but the nVidia video drivers. Once I updated these to the current ones from the nVidia site it all worked as expected.

More on using the StyleCop TFS 2010 Build Activity– handling settings files

In a recent build I wanted a bit more control over rules used by StyleCop; in the past I have just tended to have the correct ruleset in the Program Files\StyleCop directory and be done with that. This time I wanted to make sure different rules were associated with different given solutions.

The StyleCop build activity does allow for this; there is a property to set the path to the settings file. In my build process template I set this property as below, via an assignment activity

StyleCopSettingsFile = String.Format("{0}\Settings.StyleCop", localProject.Substring(0, localProject.LastIndexOf("\")))

so picking up the settings.stylecop file in the solution folder, but you could use any logic you need here, or just pass the fixed path to the settings file as a build process argument.

So I placed an edited settings.stylecop in the same folder as my .SLN file under source control and ran a build. However when it ran more rules were evaluated than I had expected, in fact all the rules from the default ruleset had been used.

What I had forgotten to do was set the merge rules for StyleCop. So I opened the setting.stylecop file in the StyleCop editor (installed when you install StyleCop on the PC)

image

I then set the setting to not merge this ruleset with any other ones, and to always re-run all the results.

Once these changes were saved and the file checked back into TFS, StyleCop ran the rules I expected.

image