But it works on my PC!

The random thoughts of Richard Fennell on technology and software development

TFS 2010 Build Service Configuration Wizard fails with TF255425 error

I have at last got round to setting up a full installation VS 2010 Test and Lab Manager using the excellent notes from the Lab Management Team. Whist installing the build server portion I got a strange set of errors.

TF255425: An error occurred while installing the following Windows service: TFSBuildServiceHost.exe. For more information, open Event Viewer and review the application log.

Error

TF255070: Configuring services for Team Foundation Build failed with the following exception: TF255425: An error occurred while installing the following Windows service: TFSBuildServiceHost.exe. For more information, open Event Viewer and review the application log..

Further investigation found the installer was claiming it could not find required files and so could not complete the install.

After a good deal of ineffective fiddling I cam to the conclusion the issue must be user access. I was using the trial Windows Server 2008 R2 vhds as the basis of my TFS server and test VMs, now these default to US region and keyboard. This had gotten on my nerves and I thought I had changed it to UK settings. However, I must have done it wrong as I had a UK keyboard in WinForm application but not in a Command Prompt. Once I made sure that my region, keyboard (and associated defaults) were all set to UK (and were working as expected in all locations) I tried the wizard again and it worked.

So it seems the issue was an incorrect password being passed to the installer. Some how the @ in Pass@word1 was being translated behind the scenes I guess to “ and causing the wizard to fail, though it always passed the verify stage of the wizard.

So the technical tip is to make sure the keyboard and region are right before you start, bit of a newbie error there!

I'm off to Ireland this week

I am off to present in Ireland this week in a double header with another of Black Marble's test team, Robert Hancock. We will be appearing at the Microsoft Ireland Visual Studio Academy. Our subject is Improved efficiency throughout the test cycle. As registration is still open I guess there are still spaces, so if it is of interest to you why not sign up (and who is not interested in testing?)

So while many of our staff are off living it up in Las Vegas for the SharePoint conference, Robert and myself have been busy building a demo rich session for the Dublin event that touchs on a whole host of different testing tools and techniques. So we hope to see you there for what should be a very interesting session.

Webcast on ASP.NET testing

I have just attended an excellent free webinar session on ASP.NET testing with Ivonna and Typemock by Gil Zilberfeld of Typemock and Artem Smirnov creator of Ivonna a Typemock add-on for unit testing ASP.NET

The session is being repeated today at 2pm GMT and I understand a recording will appear on the Typemock site in due course.

So if you get a chance this afternoon have look, it is well worth your time if you work in the ASP.NET space. Personally I have also found Ivonna useful for Sharepoint testing too, watch the session it might give you some ideas.

My Glasgow presentation last night.

Thanks to everyone who turned up for my presentation on Typemock and Sharepoint in Glasgow last night. I have just upload my slides onto the Black Marble site. As the session was quite demo driven the slides don’t offer the best code samples. If you want to experiment yourselves I would suggest you look at my related posts on this blog and remember if you don’t have Typemock you can download trial versions of all the products I used from www.typemock.com

Video recording gotta for VS2010 Test Runner

VS2010 has excellent new features to assist the tester in general, and specifically in the area of manual testing. One of these is the ability to video a manual test run; to get this to work you have to have the Windows Media Encoder 9 installed as well as the VS2010 Test Runner . If you don’t have it installed and try to use the video feature you get a dialog that warns you this component is missing and would you like to either download it or disable video recording feature for this test run.

The problem is the warning dialog has a link that takes to you the Windows Media Encoder 9 homepage. This gives you the option to install either the 32bit or 64bit version. I mistakenly assumed that I needed the version for operating system I have i.e. 64bit as I run 64bit Windows 7. THIS IS WRONG.

VS2010 Test Runner only seems to work if you have to install the 32bit and the hotfix the Test Runner dialog mentions. Once I installed the 32bit video recording of the test worked perfectly.

Logging everything that is going on when an assembly loads using CThru

Whist trying to work out if there is any way to get around the problem I am suffering with Sharepoint workflows idling inside a Typemock Isolator test harness I have been having a good look at CThru; a set if libraries for Typemock that, and I quote Codeplex here, ‘… allows creating interception and isolation frameworks for logging, testing and many other things very simply’. This is the framework is used to create the Silverlight mocking frame work on the same Codeplex site.

To aid my analysis I wrote a basic Logger using the Aspect concepts of CThru, which I call as follows:

// set the name of the types I want to monitor
TestProject.LoggingAspect.TypeNamesToMatch.Add("SharePoint");
// tell it where to look for aspects
CThru.CThruEngine.AddAspectsInAssembly(System.Reflection.Assembly.GetExecutingAssembly());
// and start it up
CThru.CThruEngine.StartListening();

The source is below is just included in my assembly, it allow me to chose if I want to log as text for CSV format. I am sure it will need editing for your logging needs but it gives you the basic idea….

using System;
using CThru;
using System.Diagnostics;
using System.Collections.Generic;
using System.Text;
 
namespace TestProject
{
    /// <summary>
    /// A sample Aspect logger for CThru
    /// </summary>
    class LoggingAspect : Aspect
    {
        /// <summary>
        /// The current logger in use
        /// </summary>
        private static IAspectLogger logger  = new DebugTextLogger() ;
 
        /// <summary>
        /// A list of the available logging formats
        /// </summary>
        public enum LoggingMethod
        {
            TextToDebug,
            CommaSeparatedToDebug
        }
 
        /// <summary>
        /// The list of string to do partial matches against when logging
        /// If any string in this list is in the namespace or typename it gets logged
        /// If this list is empty then all types are logged
        /// </summary>
        public static List<string> TypeNamesToMatch = new List<string>();
 
        /// <summary>
        /// Sets the current logging format
        /// </summary>
        public static LoggingMethod CurrentLoggingMethod
        {
            set
            {
                switch (value)
                {
                    default:
                    case LoggingMethod.TextToDebug:
                        logger = new DebugTextLogger();
                        break;
                    case LoggingMethod.CommaSeparatedToDebug:
                        logger = new DebugCVSLogger();
                        break;
                }
 
            }
 
        }
 
        public static bool LogToCSV = false;
 
        public override void StaticConstructorBehavior(DuringCallbackEventArgs e)
        {
            LogEvent("LoggingAspect.StaticConstructorBehavior", e);
        }
 
        public override void ConstructorBehavior(DuringCallbackEventArgs e)
        {
            LogEvent("LoggingAspect.ConstructorBehavior", e);
        }
 
        public override void MethodBehavior(DuringCallbackEventArgs e)
        {
            LogEvent("LoggingAspect.MethodBehavior", e);
 
            if (e.MethodName == "StsCompareStrings")
            {
                e.MethodBehavior = MethodBehaviors.ReturnsCustomValue;
                e.ReturnValueOrException = true;
            }
 
        }
 
        public override void MissingMethodBehavior(DuringCallbackEventArgs e)
        {
            LogEvent("LoggingAspect.MissingMethodBehavior", e);
        }
 
        private static void LogEvent(string description, DuringCallbackEventArgs e)
        {
            logger.LogEvent(description, e);
        }
 
        /// <summary>
        /// The control to see which 
        /// </summary>
        /// <param name="info">The info on the currently handled assembly</param>
        /// <returns>True if we should monitor this event</returns>
        public override bool ShouldIntercept(InterceptInfo info)
        {
            if (TypeNamesToMatch.Count > 0)
            {
                foreach (string name in TypeNamesToMatch)
                {
                    // find the first match of this string in a namespace typename
                    if (info.TypeName.Contains(name) == true)
                    {
                        return true;
                    }
                }
            }
            else
            {
                // none in the list match all
                return true;
            }
            return false;
        }
 
        /// <summary>
        /// Helper method to format the parameters as a list in a string
        /// </summary>
        /// <param name="e">The handled event</param>
        /// <returns>A strung listing the params and their values</returns>
        public static string ParametersListToString(DuringCallbackEventArgs e)
        {
            var sb = new StringBuilder();
            if (e.ParameterValues != null)
            {
                for (int i = 0; i < e.ParameterValues.Length; i++)
                {
 
                    if (e.ParameterValues[i] != null)
                    {
                        sb.Append(String.Format("{0} [{1}]", e.ParameterValues[i].GetType(), e.ParameterValues[i]));
                    }
                    else
                    {
                        sb.Append("null");
                    }
                    if (i < e.ParameterValues.Length - 1)
                    {
                        sb.Append(",");
                    }
                }
            }
            return sb.ToString();
        }
 
    
 
    }
 
    /// <summary>
    /// Logger interface 
    /// </summary>
    public interface IAspectLogger
    {
       void LogEvent(string description, DuringCallbackEventArgs e);
    }
 
    /// <summary>
    /// Logs an items as plain text
    /// </summary>
    public class DebugTextLogger : IAspectLogger
    {
        public void LogEvent(string description, DuringCallbackEventArgs e)
        {
            Debug.WriteLine(string.Format("{0}: {1}{2}.{3}({4})",
                description,
                e.TargetInstance == null ? "[Static] " : string.Empty,
                e.TypeName,
                e.MethodName,
                LoggingAspect.ParametersListToString(e)));
        }
    }
 
    /// <summary>
    /// Logs an items as comma separated to ease analysis
    /// </summary>
    public class DebugCVSLogger : IAspectLogger
    {
        
        public DebugCVSLogger()
        {
            // write out a header so we know the colomns
            Debug.WriteLine(string.Format("{0},{1},{2},{3},{4}",
                "Event logged",
                "Is Static",
                "Type name",
                "Method name",
                "Parameter List...."));
        }
 
        public void LogEvent(string description, DuringCallbackEventArgs e)
        {
            Debug.WriteLine(string.Format("{0},{1},{2},{3},{4}",
                description,
                e.TargetInstance == null ? "True" : "False",
                e.TypeName,
                e.MethodName,
                LoggingAspect.ParametersListToString(e)));
        }
    }
 
 
 
}

New bundle from Typemock

I have been blogging for a while now on using Tyepmock & Ivonna for various forms of testing, well you can bow buy both packages as a bundle and here is the blog/press viral marketing release…..

Unit Testing ASP.NET? ASP.NET unit testing has never been this easy.

Typemock is launching a new product for ASP.NET developers – the ASP.NET Bundle - and for the launch will be giving out FREE licenses to bloggers and their readers.

The ASP.NET Bundle is the ultimate ASP.NET unit testing solution, and offers both Typemock Isolator, a unit test tool and Ivonna, the Isolator add-on for ASP.NET unit testing, for a bargain price.

Typemock Isolator is a leading .NET unit testing tool (C# and VB.NET) for many ‘hard to test’ technologies such as SharePoint, ASP.NET, MVC, WCF, WPF, Silverlight and more. Note that for unit testing Silverlight there is an open source Isolator add-on called SilverUnit.

The first 60 bloggers who will blog this text in their blog and tell us about it, will get a Free Isolator ASP.NET Bundle license (Typemock Isolator + Ivonna). If you post this in an ASP.NET dedicated blog, you'll get a license automatically (even if more than 60 submit) during the first week of this announcement.
Also 8 bloggers will get an additional 2 licenses (each) to give away to their readers / friends.

Go ahead, click the following link for more information on how to get your free license.

Pass the word an get a chance at your free licenses…..