I had a very painful experience this week on a project. We were implementing some new features in an existing BizTalk application and the first builds on the build server were good then suddenly a number of the tests started failing with the below error in the event log.

Event Type:Error
Event Source:XLANG/s
Event Category:None
Event ID:10030
Date:8/4/2010
Time:1:36:21 PM
User:N/A
Computer:——————
Description:
Uncaught exception (see the ‘inner exception’ below) has suspended an instance of service ——————ImportMemberChange(88c96b70-f723-78d4-e8e1-d8464f189ee9)’.
The service instance will remain suspended until administratively resumed or terminated.
If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.
InstanceId: 4bb8171d-ca71-4b9b-b8b8-5f0cf5fa6abd
Shape name: Ctor
ShapeId: ec543efe-e955-4860-a1b3-7b97dc4f3038
Exception thrown from: segment 1, progress 46
Inner exception: Error encountered while executing the transform ——————.MemberImportMap. Error:Unable to create the transform..

Exception type: XTransformationFailureException
Source: Microsoft.XLANGs.Engine
Target Site: Void ApplyTransform(System.Type, System.Object[], System.Object[])
The following is a stack trace that identifies the location where the exception occured

at Microsoft.XLANGs.Core.Service.ApplyTransform(Type mapRef, Object[] outParams, Object[] inParams)
at ——————————–.ImportMemberChange.segment1(StopConditions stopOn)
at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)
Additional error information:
Could not load file or assembly ——————.Utilities, Version=999.999.999.999, Culture=neutral, PublicKeyToken=——————or one of its dependencies. The system cannot find the file specified.

Exception type: FileNotFoundException
Source: mscorlib
Target Site: System.Reflection.Assembly _nLoad(System.Reflection.AssemblyName, System.String, System.Security.Policy.Evidence, System.Reflection.Assembly, System.Threading.StackCrawlMark ByRef, Boolean, Boolean)
The following is a stack trace that identifies the location where the exception occured

at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at Microsoft.XLANGs.BaseTypes.TransformBase.get_TransformArgs()
at Microsoft.XLANGs.RuntimeTypes.TransformMetaData..ctor(Type transformBaseType)
at Microsoft.XLANGs.RuntimeTypes.TransformMetaData._creator(Type t)
at Microsoft.XLANGs.RuntimeTypes.MetadataCache._slowFor(Type t)
at Microsoft.XLANGs.RuntimeTypes.MetadataCache.For(Type t)
at Microsoft.XLANGs.RuntimeTypes.TransformMetaData.For(Type t)
at Microsoft.XLANGs.Core.Service.ApplyTransform(Type mapRef, Object[] outParams, Object[] inParams)

Basically this error is saying that the assembly the map is using to reference some functions called by the scripting functoid can not be found.

There are many forum posts along the similar lines but our situation was a little different because the build would run fine when ran locally or on the build server outside of cruise control. It was only when cruise control runs the build and does some additional steps to apply versioning to the code that we saw this problem.

After lot of investigation I found the cause of the problem when I disassembled the map assembly using Reflector. With reflector you can see the XSLTAgruments property which contains a string which outlines the expansion objects which will be used by the transform when executing. This indicates the assemblies which will be called.

In this string I could see the wrong version number had been applied during the compile of the project it was just a question of working out why.

Again after a lot more digging I found that in our case it was my old friend the Visual Studio Configuration Manager which obviously decided that it hadnt been getting enough attention recently so decided to change the Debug/Release/DEployment/Development settings within the solution. Fortunately if you have BizTalk 2009 or are planning BizTalk 2010 you shouldnt get this problem but its a big pain for 2006R2. So what happened was that during the compilation the the BizTalk project is somehow picking up a reference to the default versioned utilities component rather than the version number supplied by cruise control.

I managed to fix this by going through all of the settings in the configuration manager and lining up the Debug –> Development and Release –> Deployment settings then everything just worked.

Im not sure how the settings get changed as it wasnt done intentionally by us and the solution file is source controlled but we had added some projects to the solution so it could have gotten in that way.

Anyway on the of chance it saves someone half a day figuring this out.