BizTalk Documenter – Missing Pipeline documentation(Unable to cast COM object of type 'System.__ComObject')

Posted: February 22, 2014  |  Categories: BizTalk Uncategorized

One of my colleagues, Coen Dijkgraaf has been trying to fix some of the broken functionality in the BizTalk Server 2010 Documenter , while I have been upgrading it to work with BizTalk 2013. I mentioned that I thought that in the BizTalk Server 2006 documenter all the pipeline components of a pipeline were populated whereas in the BizTalk 2010 documenter they were missing. Sure enough when he looked he found that the BizTalk 2006 documenter produced pipeline documentation  for all the pipeline components whereas in the 2010 version produced it was missing as shown below. Jump to the end of the article if you want to see what the documentation should look like.

image

After debugging the code it was discovered that the following an exception always occurs when the pipeline documentation is being built. It occurs  in PrepareViewData method of BizTalk.Utilities.Documenter\BizTalkOM Shared Library\Microsoft.Services.Tools.BizTalkOM\Domain\Pipeline.cs on the line
object o = asm.CreateInstance(info[0]);

It Either throws  for the Default XML pipelines

{“Exception has been thrown by the target of an invocation.”}
[System.Reflection.TargetInvocationException]: {“Exception has been thrown by the target of an invocation.”}
Data: {System.Collections.ListDictionaryInternal}
HelpLink: null
InnerException: {“Unable to cast COM object of type ‘System.__ComObject’ to interface type ‘Microsoft.BizTalk.Component.Interop.IComponentTypeInfo’. This operation failed because the QueryInterface call on the COM component for the interface with IID ‘{375AA9CA-D46A-35A2-A1D3-54CEE01588F8}’ failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).”}
Message: “Exception has been thrown by the target of an invocation.”
Source: “mscorlib”
StackTrace: ”   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)\r\n   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)\r\n   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)\r\n   at System.Activator.CreateInstance(Type type, Boolean nonPublic)\r\n   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)\r\n   at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)\r\n   at System.Reflection.Assembly.CreateInstance(String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activa
tionAttributes)\r\n   at System.Reflection.Assembly.CreateInstance(String typeName)\r\n   at Microsoft.Services.Tools.BizTalkOM.Pipeline.PrepareViewData(String assemblyQualifiedName) in C:\\BTDoc-2010\\BizTalk.Utilities.Documenter\\BizTalkOM Shared Library\\Microsoft.Services.Tools.BizTalkOM\\Domain\\Pipeline.cs:line 95″
TargetSite: {System.Object CreateInstance(System.RuntimeType, Boolean, Boolean, Boolean ByRef, System.RuntimeMethodHandleInternal ByRef, Boolean ByRef)}

Or  for custom pipelines

{“Exception has been thrown by the target of an invocation.”}
[System.Reflection.TargetInvocationException]: {“Exception has been thrown by the target of an invocation.”}
Data: {System.Collections.ListDictionaryInternal}
HelpLink: null
InnerException: {“Could not load file or assembly ‘file:///C:\\Program Files (x86)\\Microsoft BizTalk Server 2010\\Pipeline Components\\Datacom.Pipeline.SchemaResolver.Component.dll’ or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.”}
Message: “Exception has been thrown by the target of an invocation.”
Source: “mscorlib”
StackTrace: ”   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)\r\n   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)\r\n   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)\r\n   at System.Activator.CreateInstance(Type type, Boolean nonPublic)\r\n   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)\r\n   at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)\r\n   at System.Reflection.Assembly.CreateInstance(String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activa
tionAttributes)\r\n   at System.Reflection.Assembly.CreateInstance(String typeName)\r\n   at Microsoft.Services.Tools.BizTalkOM.Pipeline.PrepareViewData(String assemblyQualifiedName) in C:\\BTDoc-2010\\BizTalk.Utilities.Documenter\\BizTalkOM Shared Library\\Microsoft.Services.Tools.BizTalkOM\\Domain\\Pipeline.cs:line 95″
TargetSite: {System.Object CreateInstance(System.RuntimeType, Boolean, Boolean, Boolean ByRef, System.RuntimeMethodHandleInternal ByRef, Boolean ByRef)}

The purpose of this blog article is to show how troubleshoot these types of error.

I suggested that we used Fuslogvw.exe to diagnose what assembly was not loading. The output showed that several assemblies were not loading properly. The portion of the Fuslogvwlog that gave the clue to the solution is reproduced below.

*** Assembly Binder Log Entry  (11/02/2014 @ 1:36:51 p.m.) ***

The operation failed.
Bind result: hr = 0x8013101b. No description available.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
Running under executable  C:\BTDoc-2010\BizTalk.Utilities.Documenter\Microsoft.Sdc.BiztalkDocumenter\bin\Debug\Microsoft.Services.Tools.BiztalkDocumenter.vshost.exe
— A detailed error log follows.

=== Pre-bind state information ===
LOG: User = CoenD
LOG: Where-ref bind. Location = C:\Program Files (x86)\Microsoft BizTalk Server 2010\Pipeline Components\Datacom.Pipeline.SchemaResolver.Component.dll
LOG: Appbase = file:///C:/BTDoc-2010/BizTalk.Utilities.Documenter/Microsoft.Sdc.BiztalkDocumenter/bin/Debug/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : (Unknown).
===
LOG: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: Using application configuration file: C:\BTDoc-2010\BizTalk.Utilities.Documenter\Microsoft.Sdc.BiztalkDocumenter\bin\Debug\Microsoft.Services.Tools.BiztalkDocumenter.vshost.exe.Config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft BizTalk Server 2010/Pipeline Components/Datacom.Pipeline.SchemaResolver.Component.dll.
LOG: Assembly download was successful. Attempting setup of file: C:\Program Files (x86)\Microsoft BizTalk Server 2010\Pipeline Components\Datacom.Pipeline.SchemaResolver.Component.dll
LOG: Entering run-from-source setup phase.
ERR: Error extracting manifest import from file (hr = 0x8013101b).
ERR: Failed to complete setup of assembly (hr = 0x8013101b). Probing terminated.

The documenter looks for Datacom.Pipeline.SchemaResolver.Component.dll in the correct place, but fails to extract the manifest and Error code 8013101b is COR_E_NEWER_RUNTIME.  Googling that eventually found this page http://stackoverflow.com/questions/11469592/cannot-get-to-work-vb-net-dll-referenced-by-vb6-client-in-reg-free-scenario and told us what to do. The solution  was to update  BizTalk.Utilities.Documenter\Microsoft.Sdc.BiztalkDocumenter\App.config  adding useLegacyV2RuntimeActivationPolicy=”true”. On running the changed version of the BizTalk Documenter the pipeline documentation now displays as shown below.

image

As a bonus Coen amended the code to document the default properties of the pipeline component as well. Cool bananas!!

Coen has logged these improvements to the BizTalk Server 2010 Documenter Codeplex site if you want to add them to your version.

turbo360

Back to Top