为什么我有访问权限问题在IIS 5.1中托管为Web应用程序? [英] Why I am having Access permission Issue on hosting as web application in IIS 5.1?

查看:97
本文介绍了为什么我有访问权限问题在IIS 5.1中托管为Web应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么我有访问权限问题在IIS 5.1中托管为Web应用程序?

我正在使用带有C#3.5的asp.net启动Windows服务。





我可以在调试模式下启动/停止远程机器上的服务。我正在使用服务控制器类运行服务。



托管时我收到以下错误:

System.ComponentModel.Win32Exception:访问被拒绝

Why I am having Access permission Issue on hosting as web application in IIS 5.1?
I am starting a windows service using asp.net with C# 3.5.


I am able to start/stop the service on a remote machine in debug mode. I am running a service using Service Controller Class .

while hosting I am getting the following error:
System.ComponentModel.Win32Exception: Access is denied

推荐答案

可能是因为您的代码试图访问您没有任何权限使用的硬编码文件或文件夹。



因此,检查您的代码,查找任何文件访问或路径,并检查它们。请记住,服务不会像您一样运行(您在服务启动时没有登录),因此它访问的任何文件都需要对其运行的任何用户打开。
Probably, because your code is trying to access a hard-coded file or folder that you don't have any permission to use.

So check your code, look for any file access or paths, and check them. Remember, a service doesn't run as you (you aren't logged in when the service starts) so any files it accesses need to be "open" to whatever user it is running under.


这篇关于为什么我有访问权限问题在IIS 5.1中托管为Web应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆