Svc aspNetCompatibilityEnabled=“true”导致 ServiceActivationException
我在 Web 应用程序中有一系列 svc 文件,它们都工作正常,但我需要将 aspNetCompatibilityEnabled 设置为 true 来运行,现在我收到以下异常
System.ServiceModel.ServiceActivationException:请求的服务,'...'无法激活。有关详细信息,请参阅服务器的诊断跟踪日志。
它谈到的这些跟踪日志在哪里以及可能导致这种情况的原因是什么?
谢谢
I have a series of svc files within a web application, they all worked fine but I have a need to run with aspNetCompatibilityEnabled set to true and now I get the following exception
System.ServiceModel.ServiceActivationException: The requested service, '...' could not be activated. See the server's diagnostic trace logs for more information.
Where are these trace logs that it talks about and what could be causing this?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
因此,当将 aspNetCompatibilityEnabled 设置为 true 时,您需要在几个地方应用更改。首先,我猜你已经在 web.config 文件中完成了它。其次,您需要通过使用 AspNetCompatibilityRequirements 属性装饰服务类来应用对服务的更改:
C#
VB
如果所有服务都允许,您可以使用此属性装饰基服务类,以便默认情况下所有服务都会继承它。
So when turning aspNetCompatibilityEnabled to true, you need to apply changes in a couple of places. Firstly, i'm guessing you've done it in your web.config file. Secondly, you'll need to apply changes to services by decorating the service classes with AspNetCompatibilityRequirements attributes:
C#
VB
You can, if all services allow it, decorate a base service class with this attribute so it's inherited by all services by default.
您可以通过将以下内容添加到 web.config 来激活广泛的日志记录信息:
然后您可以使用 SvcTraceViewer.exe 查看日志文件
You could activate extensive logging information by adding the following to your web.config:
Then you could use SvcTraceViewer.exe to view the log file