3

この例外が発生しています。

内部エラーのため、サーバーは要求を処理できませんでした。エラーの詳細については、サーバーで ( ServiceBehaviorAttribute または構成動作のいずれかから) IncludeExceptionDetailInFaults をオンにして、例外情報をクライアントに送り返すか、Microsoft .NET Framework 3.0 SDK ドキュメントに従ってトレースをオンにします。サーバーのトレース ログを調べます。

この設定を流暢なAPIで追加したい

<serviceBehaviors>
  <behavior name="metadataAndDebugEnabled">
    <serviceDebug
      includeExceptionDetailInFaults="true"
    />
    <serviceMetadata
      httpGetEnabled="true"
      httpGetUrl=""
    />
  </behavior>
</serviceBehaviors>

方法はありますか?これが私の現在の構成です...

Container.Register(
    AllTypes.FromAssemblyNamed("My.Server.Services")
        .Pick().If(type => type.GetInterfaces().Any(i => i.IsDefined(typeof(ServiceContractAttribute), true)))
        .Configure(configurer => configurer.Named(configurer.Implementation.Name)
            .LifeStyle.PerWcfOperation()
            .AsWcfService(
                new DefaultServiceModel()
                    .AddEndpoints(
                        WcfEndpoint.BoundTo(new NetTcpBinding { PortSharingEnabled = true }).At(string.Format("net.tcp://localhost:6969/{0}", configurer.Implementation.Name)),
                        WcfEndpoint.BoundTo(new NetNamedPipeBinding()).At(string.Format("net.pipe://localhost/{0}", configurer.Implementation.Name)))
                    .PublishMetadata()
            )
        )
        .WithService.Select((type, baseTypes) => type.GetInterfaces().Where(i => i.IsDefined(typeof(ServiceContractAttribute), true))));
4

1 に答える 1

1

私の知る限り、特定のオプションを使用して実装をコンテナーに登録するIServiceBehaviorと、WCF 統合機能がそのインスタンスを使用します。

于 2011-12-15T13:34:28.810 に答える