Aufruf von PipelineObjects schlägt mit Ausnahme fehl

Dieser Artikel enthält eine Lösung für den Fehler, wenn Sie von Ihrer Anwendung aus einen Aufruf in die PipelineObjects ausführen.

Ursprüngliche Produktversion:   BizTalk Server 2013, 2010
Ursprüngliche KB-Nummer:   2888774

Problembeschreibung

Wenn Sie einen Aufruf an die PipelineObjects Assembly aus Ihrer eigenen Anwendung ausführen, tritt möglicherweise ein Fehler wie der folgende auf:

System.Reflection.TargetInvocationException wurde nicht behandelt
HResult=-2146232828
Message=Exception wurde vom Ziel eines Aufrufs ausgelöst.
Source=mscorlib
Stacktrace:
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached,
RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at Microsoft.Test.BizTalk.PipelineObjects.PipelineFactory.CreatePipelineFromType(Type pipelineType)
at MyTestApp.Program.Main(String[] args) in C:\MyTestApp\Program.cs:line 9
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.InvalidCastException
HResult=-2147467262
Message=Com-Objekt vom Typ "System.__ComObject" kann nicht in den Schnittstellentyp "Microsoft.BizTalk.Component.Interop.IComponentTypeInfo" umgewandelt werden. Dieser Vorgang ist fehlgeschlagen, da der QueryInterface-Aufruf der COM-Komponente für die Schnittstelle mit IID '{custom IID}' aufgrund des folgenden Fehlers fehlgeschlagen ist: Keine solche Schnittstelle unterstützt (Ausnahme von HRESULT: 0x80004002 (E_NOINTERFACE)).
Source=Microsoft.BizTalk.Pipeline
Stacktrace:
at Microsoft.BizTalk.PipelineOM.Pipeline.AddComponent(Stage stage, IBaseComponent realComponent)
bei MyPipeline.MySendPipeline.. ctor()

Ursache

PipelineObjects.dllerfordert, dass die Microsoft .NET Framework Laufzeitaktivierungsrichtlinie von der Anwendung verwendet wird, die sie aufruft.

Lösung

Ändern Sie die app.config für den PipelineObjects ausführbaren Aufruf, um das folgende Element einzuschließen: <startup>

<configuration>
    <startup useLegacyV2RuntimeActivationPolicy="true">
        <supportedRuntime version="v4.0" />
    </startup>
</configuration>

Weitere Informationen

PipelineObjects.dll ist ein Tool, das im BizTalk Software Development Kit (SDK) bereitgestellt wird und sich im SDK\Utilities\PipelineTools Ordner befindet.

Weitere Informationen zum <startup> Element finden Sie unter <startup> Element.