WCF service works in cassini, but not in IIS

走远了吗. 提交于 2019-12-13 03:37:19

问题


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,

  1. 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.

  2. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!