WCF and IIS error 500 when using diagnostics
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 Err开发者_如何学运维or..
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?
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.
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.
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.
精彩评论