从IIS7.5读取网络上的文件
我有一个在 Windows Server 2008 R2 Enterprise 上运行的 WCF 服务。 IIS 版本是 7.5。该服务中的方法之一从网络上的文件读取。当它尝试执行此操作时失败,但我无法记录正确的错误来找出原因。我的猜测是这是一个权限问题,但由于不熟悉 IIS,我不知道从哪里开始。
运行我的服务的站点正在使用以 NetwrokService 作为身份的应用程序池。我尝试过其他内置帐户,但遇到了同样的问题。在任务管理器中查看正在运行的进程时,我看到 w3wp.exe 正在 NetworkService 帐户下运行 - 这就是应用程序池的配置方式。
我正在尝试访问共享,例如:\Machine1\SharedFiles\MyFile.txt。我可以从文件资源管理器轻松访问相同的共享,因此我知道它是有效的。该服务的所有其他部分都按预期运行,这让我相信我的 IIS 配置很好 - 除了可能允许读取其他计算机上的文件的权限设置之外。
有人知道我做错了什么吗?
谢谢,
I have a WCF Service running on Windows Server 2008 R2 Enterprise. The IIS Version is 7.5. One of the methods in the service reads from a file on the network. It's failing when it tries to do this, but I can't log a proper error to find out why. My guess is that this is a permissions issue, but not being savvy with IIS, I don't know where to start.
The site running my service is using an App Pool with NetwrokService as the Identity. I have tried other built-in accounts, but I get the same problem. When looking at the running processes in Task Manager, I see w3wp.exe is running under the NetworkService account - which is how the App Pool is configured.
I'm trying to reach a share such as: \Machine1\SharedFiles\MyFile.txt. I can access this same share easily from file explorer so I know it's valid. Every other part of the service runs as expected which leads me to believe my IIS configuration is fine - other than possibly a permission setting that allows reading of files on other machines.
Anyone have any idea what I am doing wrong?
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从这里开始:
http://learn.iis.net/page.aspx/624/ application-pool-identities/
这是一个权限问题。共享及其中的文件需要向 IIS 服务器计算机帐户授予访问权限。
Start here:
http://learn.iis.net/page.aspx/624/application-pool-identities/
It is a permission issue. The share, and the files within it, need to grant access to the IIS servers machine account.