Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it Possible to turn on IncludeExceptionDetailInFaults with castle windsor fluent api?

I am getting this exception.

The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.

I want to add this configuration with fluent api

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

Is there a way for it? Here is my current configuration ...

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))));
like image 901
Serdar Avatar asked Nov 21 '25 22:11

Serdar


1 Answers

AFAIK You could register an IServiceBehavior implementation with your specific options to container and WCF Integration facility will use that instance.

like image 132
Berke Sökhan Avatar answered Nov 24 '25 21:11

Berke Sökhan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!