我读过其他关于如何实现此目标的帖子,但无济于事。当我将应用程序部署到服务器(2008)时,我在运行时遇到以下异常:
Access to the registry key 'HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\TeamFoundation\Servers' is denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.UnauthorizedAccessException: Access to the registry key 'HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\TeamFoundation\Servers' is denied.
ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
要授予 ASP.NET 对文件的访问权限,请在资源管理器中右键单击该文件,选择“属性”,然后选择“安全”选项卡。单击“添加”以添加适当的用户或组。突出显示 ASP.NET 帐户,然后选中所需访问权限的框。
所以这个错误看起来非常具有描述性。我打开 regedit 并右键单击密钥 (HKEY_CURRENT_USER\Software\Microsoft) --> 权限 --> 添加用户“NETWORK SERIVCE”并授予完全控制权。
我假设这是 ASP.NET 运行来访问注册表的用户。
然后我尝试禁用“包括来自该对象父对象的可继承权限”。
这也行不通。
在 IIS 管理器中,在应用程序的身份验证设置下,我将“匿名身份验证”用户设置为我自己的用户,该用户位于管理员组中。
似乎没什么作用。
我该如何解决这个问题?这是在我们本地网络上运行的内部工具,因此现阶段我不太关心安全权限。我如何授予适当的权限?
Thanks!
如果不知道您的 Web 应用程序想要完成什么任务,就很难进行故障排除。但是,我假设这是一个基于网络的应用程序,这意味着您已经为您的网络创建了一个数据库。首先,在 Web.config 'connectionString' 中,尝试使用用于登录 SQL Server Management 的用户名和密码。不要使用 Windows 登录。其次,尝试使用 F5 功能键运行您的应用程序。这将启动 Visual Studio 2008 附带的内置服务器。这不需要本地 IIS。
如果仍然有问题,请发布或发送给我您的 Web.config。看看我能不能帮忙。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)