But it works on my PC!

The random thoughts of Richard Fennell on technology and software development

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

Where do I find the product key for Team Explorer Everywhere?

When TEE is installed you have to provide a product key if you do not wish to run it in 90 day trial mode. Those of you used to using MSDN Subscriber downloads would guess you press the Key button next to the Download button and a product will be provided. However this is not the case, all you get is the message the product does not require a key.

image

The answer is actually simple, you are just in the wrong place. You need to go back to the subscriptions menu and look in ‘My Product Keys’

image

Scroll down and you will find you TEE key in the list

image

Linking a TFS work item to a specific version of a document in SharePoint

SharePoint in my opinion is a better home for a Word or Visio requirements document than TFS. You can use all the SharePoint document workspace features to allow collaboration in the production of the document. When you have done enough definition to create your projects user stories or requirement then you can create them in TFS using whatever client you wish e.g. Visual Studio, Excel, Project etc.

You can add a Hyperlink from each of these work items back to the SharePoint hosted document they relate to, so you still retain the single version of the source document. The thing to note here is that you don’t have to link to the last version of the document. If SharePoint’s revision control is enabled for the document library you can refer to any stored version. Thus allowing the specification document to continue evolving for future releases whilst the development team are still able to reference the specific version their requirements are based on.

The process to do this is as follows..

Open your version history enabled document library, select the dropdown for a document and select version history

image

If you cut the hyperlink for the 4.0 version of the document you get an ordinary Url link  “…/BlackMarble/SharePoint Engagement Document.docx”

If you cut the hyperlink for the 2.0 version of the document you get  a Url like this with a version in it “.../_vti_history/1024/Black Marble/SharePoint Engagement Document.docx”

You can paste these into ‘Add link to requirement’ dialog as often as required

image

So there is a link to each revision of the document

image

More on running multiple TFS build controllers on a single VM

I have been having a on-going project to run multiple build controllers on a single VM. Today I needed to reconfigure a on of the controllers to point at a different TPC. You have to do this the correct way to avoid problems.

My error log was full of

Http communication failure:
Exception Message: Cannot listen on pipe name 'net.pipe://build/ServiceHost/1' because another pipe endpoint is already listening on that name. (type AddressAlreadyInUseException)

It all boiled down to the fact I ended up with two controllers trying to use the same URI, in my case

vstfs:///Build/ServiceHost/1

The number at the end of this URI is assigned when the controller is registered with a TPC. If, as I did, you just stop a controller and edit its properties to point at another TPC and restart it, it is possible to end up with two controllers on the same box trying to use the same ID.

The simple fix is to unregister the build controller and the register it with the new TPC as needed. This will cause the machine to be scanned and new, empty ID chosen for the URI. As as detailed in Jim Lamb’s original post.

As a side effect I also saw errors in the log saying custom activity assemblies could not be loaded due to permission errors. This all turned out to be that the custom activities are stored in

C:\Users\[tfs build account]\AppData\Local\Temp\BuildAgent\[agent ID] 

So if two agents have on the ID, even if one’s parent controller is failing to load fully, it will tend to lock the files for the other controller. Again this was fixed by registering the controller and agents in the correct manner