2012-01-01 3 views
1

アンマネージドDLLを内部的に参照するマネージドDLLがあります。この管理DLLは、私のWCFサービスプロジェクトへの参照として追加されます。ただし、アンマネージDLLは、プロジェクトのビルド出力パスに手動でコピーする必要があります。それらはVisual Studio内で参照することはできません。アンマネージドDLLを使用したWCFサービスのホスト

Visual StudioのWCFサービスホスト内でサービスDLLを実行しようとすると、後者は例外なくクラッシュし、自動的に再起動します。 IISでサービスDLLをホストしようとするとSampeが適用されます。 IISとProblemSignaturesで開催しようとしたとき、私はWERReportMetadataのクラッシュログの1つをキャッチすることができたと言う:

<ProblemSignatures> 
    <EventType>CLR20r3</EventType> 
    <Parameter0>webdev.webserver40.exe</Parameter0> 
    <Parameter1>10.0.0.0</Parameter1> 
    <Parameter2>4d5f345a</Parameter2> 
    <Parameter3>GTAPIASM</Parameter3> 
    <Parameter4>2.0.5.0</Parameter4> 
    <Parameter5>4e9254a5</Parameter5> 
    <Parameter6>166</Parameter6> 
    <Parameter7>23</Parameter7> 
    <Parameter8>System.AccessViolationException</Parameter8> 
    </ProblemSignatures> 

は、この平均値とどのように私はそれについて何ができるのでしょうか?アンマネージDLLを使用したWCFホスティングに関する参照資料も便利です。

編集1:アンマネージドDLLを%systemroot%\ syswow64にコピーすると、Visual Studio WCFサービスホストを使用してサービスをホストできます。私はhereからのヒントを得た。ただし、これによってWebDev.WebDServer40.exeがクラッシュすることはありません。

編集2これは、イベントビューアからキャプチャ.NETランタイムエラーです:

アプリケーション:WebDev.WebServer40.exe Frameworkのバージョン:v4.0.30319 説明:プロセスが未処理の例外が原因で終了しました。 例外情報:System.TypeInitializationExceptionスタック: System.RuntimeMethodHandle._InvokeConstructor System.RuntimeMethodHandle.InvokeConstructor(System.IRuntimeMethodInfo、 で(System.IRuntimeMethodInfo、 System.Objectの[]、System.SignatureStructのByRef、System.RuntimeType)でSystem.Objectの[]、System.SignatureStruct、System.RuntimeType) System.Reflection.RuntimeConstructorInfo.Invoke(System.Reflection.BindingFlags、 System.Reflection.Binder、System.Objectの[]、 可能System.Globalization.CultureInfo)で(サービスタイプ)。 System.ServiceModel.ServiceHost.CreateDescriptionで System.ServiceModel.Description.ServiceDescription.GetService(のSystem.Type) でleton(System.ServiceModel.Description.ServiceDescription、 のSystem.Object、ブール)(System.Collections.Generic。 System.ServiceModel.ServiceHostでSystem.ServiceModel.ServiceHostBase.InitializeDescription(System.ServiceModel.UriSchemeKeyedCollection)System.ServiceModel.ServiceHost.InitializeDescription(のSystem.Typeで 、 System.ServiceModel.UriSchemeKeyedCollection)でIDictionary`2 のByRef) ..ctor(System.Type、System.Uri []) にSystem.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(System.Type、 )System.Uri [] ) System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(可能System.String、 可能System.Uri [])で System.ServiceModel.ServiceHostingEnvironment + HostingManager.CreateService(可能System.String) でSystem.ServiceModel.ServiceHostingEnvironment + HostingManagerで System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(システムで System.ServiceModel.ServiceHostingEnvironment + HostingManager.EnsureServiceAvailable(可能System.String) で.ActivateService(可能System.String) 。 でSystem.ServiceModel.Activation.HostedHttpRequestAsyncResult.OnBeginRequest(System.Objectので System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest() でSystem.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest() に文字列) ) システムで System.Runtime.Fx + IOCompletionThunk.UnhandledExceptionFrameでSystem.Runtime.IOThreadScheduler + ScheduledOverlapped.IOCallback(UInt32型、UInt32型 、System.Threading.NativeOverlapped *)(UInt32型、UInt32型 、System.Threading.NativeOverlapped *)。 Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32, UInt32、System .Threading.NativeOverlapped *)

編集2:

は、私はすべての回で管理者としてのVisual Studioを実行する必要が判明します。これにより、以前のエラーが解消されます。

ありがとうございました。

答えて

0

%systemroot%\ syswow64にアンマネージDLLを追加する必要がありました。これはVisual StudioのWCFサービスホストとASP開発サーバーでサービスを実行できますか。