问题
I created a service that has a database connection which is working fine in Cassini, when in copy the service to the inetpub all works fine except database calls, they always return this error:
The server encountered an error processing the request. See server logs for more details."
Now i have 2 questions,
I can find server logs in my C:\inetpub\logs\LogFiles\W3SVC1 folder. But are these the ones mentioned because these do not seem to contain any usefull data.
How is it possible that everything works in Cassini but not in IIS?
If there are any questions about my question please go ahead!
Edit I am using Visual studio team system 2008 and IIS 7.0
回答1:
Run Visual Studio as administrator
回答2:
This is normally a permissions problem.
If you are using defaults:
- The connection string is using a trusted connection
- When you run via cassini you are in the security context of your user
- When you run via IIS you are in the security context of the identity of the application pool which is network service.
To fix it you could:
- change the connection string
- change the identity of the application pool
- give network service access to your database
回答3:
My guess is permissions. Are you using Windows authentication?
In the case of Windows authentication: http://www.codeguru.com/csharp/.net/net_security/authentication/article.php/c7725
来源:https://stackoverflow.com/questions/5553076/wcf-service-works-in-cassini-but-not-in-iis