gpt4 book ai didi

caSTLe-windsor - 是否可以使用 caSTLe Windsor Fluent api 打开 IncludeExceptionDetailInFaults?

转载 作者:行者123 更新时间:2023-12-02 10:16:32 25 4
gpt4 key购买 nike

我遇到了这个异常。

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.

我想使用 Fluent 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))));

最佳答案

据我所知,您可以使用容器的特定选项注册一个 IServiceBehavior 实现,WCF 集成工具将使用该实例。

关于caSTLe-windsor - 是否可以使用 caSTLe Windsor Fluent api 打开 IncludeExceptionDetailInFaults?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8519216/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com