The blogs of Black Marble staff

Type ‘InArgument(mtbwa:BuildSettings)’ of property ‘BuildSettings’ errors in TFS 2012 RTM builds

I posted a while ago that you saw errors when trying to edit TFS 2012RC build process templates in VS 2012RC if the Visual Studio class library project you were using to manage the process template editing was targeting .NET 4.5, it needed to be 4.0. Well with Visual Studio 2012 RTM this is no longer the case, in fact it is the other way around.

I have recently upgraded our TFS 2012 RC –> RTM and I today came to edit one of our build process templates (using the standard method to edit a process template with custom activities) and got the following error when I tried to open the XAML process template for editing

System.Xaml.XamlException: 'The type ‘InArgument(mtbwa:BuildSettings)’ of property ‘BuildSettings’ could not be resolved.' Line number '3' and line position '38'.



At first I assumed it was my custom activities, so I tried editing the DefaultTemplate.11.1.xaml in the same manner, but got the same problem.

Strangely I found that if I had no solution open in Visual Studio then I could just double click on the DefaultTemplate.11.1.xaml file in Source Control Explorer and it opened without error. However, if I had a solution open in the same instance of VS2012 that contained a class library project that linked to the same XAML file I got the error. Unloading the project within the solution allowed me to open the file via Source Control Explorer, reloading the project again stopped it loading.

So it all pointed to something about the containing class library project stopping referenced assemblies loading. On checking the project properties I saw that it was targeting .NET 4.0 (as required for the RC), as soon as I changed this to .NET 4.5 it was able to load all the required Team Foundation assemblies and I was able to edit both the default template and my custom build process template.

DDD North 2012

The Northern wing of the UK’s premier Developer Community event is coming to Yorkshire on the 13th October.  Here are some things you need to know!DDDNlogo

Black Marble is supporting this event – so look forward to seeing you in October!

Getting Typemock Isolator running within a TFS 2012 build – part 2

I posted previously on getting Typemock 7.x running in a TFS 2012 RC build process . Well it seems the activities I previously published did not work on the TFS 2012 RTM build i.e if you do nothing other than upgrade your TFS server from RC to RTM a previously working build fails, no attempt was made to run any tests and I got the unhelpful error

TF900546: An unexpected error occurred while running the RunTests activity: 'Executor process exited.'.

Note: TF900546 seems to be the generic – test failed error number. If you see it you will usually have to look elsewhere for anything helpful.

So I assumed that the problem must be some difference with the TeamFoundation assemblies I was referencing between the RC and RTM versions, so I rebuilt my activities, all to no effect, I got the same error. So I did some more digging into the code. I found a number of issues, why these had not caused an issue before I don’t know:

Target property

If you do not specify a .NET version via the Target property of the TypeMockRegister activity it does not attempt to start interception. As setting this property every time you want to use the activity is a pain, I modified the activity so that if no Target property is passed then the value v4.0.30319 is used, the version of .NET 4.5 as it appears in the c:\windows\Microsoft.Net\framework folder.

Note Missing of the leading v if the Target value causes the TFS build agent to hang, I have no idea why.

Once this change was made the build ran and it tried to run all my tests, but the ones involving Typemock failed, with the message

Test method BuildProcessValidation.Tests.MSTestTypemockTests.DirtyTrickMockingWithTypemock_Email_is_sent_when_client_order_is_processed threw exception:
System.TypeInitializationException: The type initializer for 'f5' threw an exception. ---> System.TypeInitializationException: The type initializer for 'TypeMock.InterceptorsWrapper' threw an exception. ---> TypeMock.TypeMockException:
*** Typemock Isolator needs to be linked with Coverage Tool to run, to enable do one of the following:
   1. link the Coverage tool through the Typemock Isolator Configuration
   2. run tests via TMockRunner.exe -link
   3. use TypeMockStart tasks for MSBuild or NAnt with Link
For more information consult the documentation (see Code Coverage with Typemock Isolator topic)

On looking in the build box’s event log I saw the message

.NET Runtime version 4.0.30319.17929 - Loading profiler failed during CoCreateInstance.  Profiler CLSID: '{B146457E-9AED-4624-B1E5-968D274416EC}'.  HRESULT: 0x8007007e.  Process ID (decimal): 2068.  Message ID: [0x2504].


Basically the issue was the Typemock interceptor, the profiler, was not being started because Typemock was not installed on the build box. To prove this I manually installed Typemock on the build box and the error went away, all my tests ran. So happy my activity basically worked, I removed Typemock from the build box and the problem returned, so I know I had an autodeployment issue.

On checking the activity code again I found I was not handling the nullable boolean correctly for the AutoDeploy build argument of the type TypemockSettings. As soon as this was fixed and deployed by build leapt into life.

In summary

So I am please to say I have a working activity again, as I said in my previous post I see this as stopgap measure until Typemock Release their official version. This set of activities have had minimal testing and I am not sure the undeploy logic is working fully, but as I don’t need this feature I am not worrying about it for now.

Hope you find it useful in its current state.

Experiences upgrading our TFS2012RC to RTM

We have just completed the upgraded of our TFS2012 server from RC to RTM. All went smoothly, just a few comments worth mentioning

  • The install of TFS2012 (after the removal of the RC) required three reboots, 2 for C++ components and one for .NET 4.5. So  if seeing reboots don’t worry too much.
  • When running the upgrade wizard we got a verify warning over port 443 already being used (we had manually configured via IIS manager for our server to use 8080 and 443). We ignored this warning. However after the upgrade wizard had completed, with no errors, we found that the new web server could not start. Turns out it it had been left bound as HTTP to Port 443, so it was very confused. We just deleted this binding and re-added HTTP on 8080 and HTTPS on 433 with our wildcard certificate and it was fine. So in hindsight we should have headed the warning and removed our custom bindings.

So now off to the long job of upgrading build box, test controller and the rest.

Weekend trip to see family – 1 OS upgrade, 1 network printer installed and 3 machines de-virused

I have been away over the weekend seeing family, and as anyone who is in IT (or is a medical doctor I suspect) would expect I had the standard experience – everyone wanted me to show me something they were worried about that turned to be virus related. This trip I did one operating system upgrade, one network printer installation and de-virused three PCs. So nothing out of ordinary.

The one thing I would mention was how useful I found the contents of Mark Russinovich’s TechEd Session ‘Malware Hunting with the Sysinterals Tools’. This saved me the complete machine rebuild I had feared for one PC which had got infected with a bit of poor quality ransomware  that turns out to only be a splash screen that I could easily spot with Autoruns from the Sysinternals Suite. The video is well worth a watch for all of us in the family IT support game.

A move to Windows 8 RTM (and VS2012 RTM), not too painful

First I thought I could do an in-place upgrade of my Windows 8RC PC, turns out you can’t (not sure if it would have been wise anyway) so it was format disk time.

I had hoped for a seamless install of Windows 8, but it hung after detecting devices. It seems it was the ‘old problem’ down to Lenovo/Nvidia Optimus graphics drivers issues. So I checked my bios settings which were set to Nvidia Optimus mode disabled (the only way I could get the RC to install), and changed it to Optimus mode enable and the install all worked without an issue. However though as a laptop it work find,  including with a second external monitor. I did have to set Optimus back to disabled and run in discrete video mode if I wanted to use a projector. It seems the Optimus mode certainly gets confused with the Benq projector we have in the office, it will allow you to extend your desktop but not duplicate it. As soon as you switch back to discrete graphic mode all is OK (though you do lose the ability to run two external monitors)

On completing the installation I ran a Windows update which found an update Lenovo display driver (it had no effect on the Optimus issue) and Conexant audio driver (one I had to manually update on the RC to get Lync 2013 working).

However, on checking the Device Manager I was still missing drives for a couple of devices


I think they are Power Management and Intel AMT, but the beta drivers from Lenovo don’t seem to work so I will need to keep looking.

So now to see how it runs, first impressions are good, seem quick.

Moving podcast subscriptions with Zune

If like me you listen to many podcasts, then swapping the PC your Phone7 syncs to collect the podcasta is a real pain. The problem being as far as I can see Zune has no podcast subscription export/import, so you are left with a lot of copy typing to re-enter them.

Whilst rebuilding my PC with Windows 8 today I have at least found a work around

  1. On your old Pc open you ‘c:\user\[user]\My Podcasts’ folder (shown in Windows Explorer as the ‘Podcast’ folder).
  2. You will see a folder for each podcast you are subscribed to
  3. Copy the whole folder to the same location on your new PC (I did via a USB drive as I was reformatting the disk on the same PC)
  4. Install Zune on the new PC
  5. Open Zune and look in the Collection>Podcasts, you should see all your podcast – but your are not subscribed yet
  6. In Zune, highlight and select all podcasts
  7. Right click and you should see  a Subscribe option, select it.
  8. Zune now sorts itself out re-subscribing and checking for new programmes
  9. It gets a bit confused over what you have watched so might pull them down again. Also you might want to alter subscription settings for specific podcasts as it will default back to just 3 programmes.
  10. When you are happy with your settings just drag the podcasts onto your newly resync’d mobile device to finish the job.
  11. You might need to look at the podcasts that are on the device as seems it does not removed one previously there via Zune (again it seems unsure of what you have listened too)

Not perfect but better than trying to removed load of site URLs

Visual Studio 2012 RTM and the ALM Rangers SIM Ship best practice guidance

Overnight Visual Studio and TFS 2012 became available on MSDN for download; I really pleased to say that the ALM Rangers also SIM shipped all our 2012 guidance at the same time

I have been working on two of the Ranger project for the past year and have to say I have learnt a lot working with such a great crowd of Microsoft and external TFS experts. Some stuff I learnt was about the 2012 release it is true, but there was plenty on working with a a globally distributed team with a whole host of logistical and time constraints.

It has been a blast, but there is still more to do. Keep an eye open for supplementary ranger guidance releases in the next few months, but for now why not download and read the released guidance and do the hands on labs. I really do think they will answer many questions you have about TFS.