gpt4 book ai didi

使用 Ninject 在 Azure 上部署 WCF 服务时出现故障

转载 作者:行者123 更新时间:2023-12-03 00:34:06 25 4
gpt4 key购买 nike

从今天早上开始,我一直收到以下错误:(

The requested service, 'http://10.175.156.xx:yyyyy/SomeService.svc' could not be activated. See the server's diagnostic trace logs for more information.

当我在 Azure 上打开 svc 日志时,我看到以下警告和错误:

W: Failed to open Ninjet.Extensions.Wcf.NinjectIISHostingServiceHost`1[MyNameSpace.Servicelayer.SomesSrvice W: Faulted Ninject.Extensions.WCf.NinjectIISHostingServiceHost[MyNamespace.ServiceLayer.SomeService] W: ServiceHost faulted

有时,我会看到以下错误,然后出现上述警告:

E: Loading performance counters for the service failed. Performance counters will not be available for this service. Instance 'SomeService@||SomeService.svc' already exists in CounterSet 'e829b6db-21ab-453b-83c9-d980ec708edd'. Parameter name: InstanceName

上周一直运行良好,我在 Azure 上没有看到任何变化。

顺便说一句,它在本地运行良好。

编辑:由于我还无法回答自己的问题,因此我正在编辑帖子以包含“解决方案”:(

`好的!看起来这个问题缺少一些引用:(

我向 WCF 项目添加了一个类库项目,并且该类库引用了 MVC 4。`

最佳答案

有两个人提到应用程序运行良好,但问题开始发生。正如您提到的引用丢失,正在运行的应用程序由于缺少引用而停止工作并不奇怪。当问题开始出现时是否有任何触发因素,即虚拟机回收、部署更新等,或者您是否已将以前的 MVC 更新到 MVC4?

关于您的“加载服务性能计数器失败”问题,可能是由 ServiceHost 的严格关闭/打开顺序中的时序问题引起。 ServiceHost 确实维护了无法被垃圾收集并导致此异常的特定性能计数器。您可以使用下面的代码来解决此问题:

GC.Collect() 
GC.WaitForPendingFinalizers()

根据我的经验,“请求的服务,* 无法激活”问题可能是由于缺少特定配置而发生,由于连接时间较长或应用程序内的运行时问题而发生超时。通过添加适当的引用肯定可以解决您的问题,但是您可能还需要查看服务配置以进一步避免此类问题。

关于使用 Ninject 在 Azure 上部署 WCF 服务时出现故障,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12681286/

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