使用诊断时 WCF 和 IIS 错误 500
使用诊断时,我在 IIS 上遇到 WCF 问题。
当我调用该服务时,出现以下错误:
System.Net.WebException:远程 服务器返回错误:(500) 内部服务器错误..
如果我删除“system.diagnostics”部分,我不会收到错误 500,但会收到错误
请求的服务, 'http://localhost/CustomerServiceSite/Customer.svc' 无法激活。请参阅 服务器的诊断跟踪日志 更多信息..
这显然需要诊断才能修复。
知道为什么诊断不起作用吗?
I have problem with WCF on IIS when using diagnostics.
When I call the service I get the following error:
System.Net.WebException: The remote
server returned an error: (500)
Internal Server Error..
If I remove "system.diagnostics" section I dont get error 500 but I get an error
The requested service,
'http://localhost/CustomerServiceSite/Customer.svc'
could not be activated. See the
server's diagnostic trace logs for
more information..
Which obviously needs diagnostics to get fixed.
Any idea why diagnostics doesnt work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
检查 Web 服务器上的事件日志 - 应记录 http 500。另请检查在 IIS 中运行 AppPool 的帐户是否具有对用于诊断的文件的访问权限。
Check event log on web server - http 500 should be logged there. Also check that Account running your AppPool in IIS has access rights to file used for diagnostics.
诊断程序会将跟踪文件写入磁盘 - 也许运行 WCF/ASP.NET 的用户帐户没有写入该文件的权限。
The diagnostics will write a trace file to disk - maybe the user account WCF/ASP.NET is running under doesn't have permissions to write the file.
如果我在浏览器中打开我的服务(http://localhost/CustomerServiceSite/Customer.svc)我有看到了整个错误。
问题是因为我以错误的方式使用 NHibernate 和 Diagnostics。评论 NHibernate 配置解决了我的问题。
If I opened my service in browser (http://localhost/CustomerServiceSite/Customer.svc) I have seen the whole error.
The problem was becouse I used NHibernate and Diagnostics in wrong way. Commenting NHibernate configuration solved my problem.