Visual Studio Web 部署项目破坏了 ASPNET 帐户权限

发布于 2024-10-16 03:31:20 字数 1591 浏览 4 评论 0原文

我使用 Visual Studio 2008 和目标框架版本 2.0 构建了一个 ASP.NET Web 应用程序。我创建了一个 Web 安装项目来将其部署在多个目标操作系统上。

对于设置项目,我编写了一个自定义操作,该操作在“OnCommitting”事件上执行。此自定义操作添加通配符脚本映射,以便通过 ASP.NET 引擎路由所有请求。

FileMon 提示在以下目录中创建文件时发生错误:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files

尝试此操作的用户帐户是 IWAM_<主机名>。

问题是运行此设置后,如果我尝试访问新安装的站点上的任何 url,我会收到错误消息:

“/myapp”应用程序中的服务器错误。

无法访问 IIS 元数据库。

描述:执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其在代码中的来源的更多信息。

异常详细信息:System.Web.Hosting.HostingEnvironmentException:无法访问 IIS 元数据库。

用于运行 ASP.NET 的进程帐户必须具有 IIS 元数据库的读取访问权限(例如 IIS://servername/W3SVC)。有关修改元数据库权限的信息,请参阅 http://support.microsoft.com/?kbid=267904< /a>.

源错误:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

经过 2 天的谷歌搜索后,我已经尝试过这些选项:

  1. 运行 aspnet_regiis -i
  2. 运行 aspnet_regiis -ga \ASPNET
  3. 运行 aspnet_regiis -u 然后 aspnet_regiis -i

选项 3 有到目前为止为我工作,但是,我想避免使用它,因为我的网络应用程序将部署在一台可能已经在 IIS 上托管其他应用程序的计算机上,并且我不想打扰这些应用程序。

谁能建议我解决这个问题?

顺便说一句,我当前的系统在 Win XP SP3 和 IIS 5.1 上安装了 .Net Framework 3.5 和 VS2008。

谢谢,
瓦米普

I have built an ASP.NET web application with Visual Studio 2008 and target framework version 2.0. I have created a Web Setup project to deploy this at multiple target OSes.

For the setup project, I have written a custom action which gets executed on "OnCommitting" event. This custom action adds wildcard script mapping for routing all requests through ASP.NET engine.

FileMon suggests that an error occurs while creating a file in the following directory:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files

The user account which was attempting this action was IWAM_<host name>.

The problem is after running this setup, if I try to access any url on the newly installed site, I received the error message:

Server Error in '/myapp' Application.

Failed to access IIS metabase.

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.Web.Hosting.HostingEnvironmentException: Failed to access IIS metabase.

The process account used to run ASP.NET must have read access to the IIS metabase (e.g. IIS://servername/W3SVC). For information on modifying metabase permissions, please see http://support.microsoft.com/?kbid=267904.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

I have already tried these options after 2 days of googling:

  1. Run aspnet_regiis -i
  2. Run aspnet_regiis -ga \ASPNET
  3. Run aspnet_regiis -u and then aspnet_regiis -i

Option 3 has worked for me as of now, but, I want avoid using this, since, my web app will be deployed on a machine which might already be hosting some other app on IIS and I do not want to disturb these apps.

Can anyone suggest me a workaround for this?

B.T.W. my current system has .Net framework 3.5 and VS2008 installed on Win XP SP3 and IIS 5.1.

Thanks,
Vamyip

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

合久必婚 2024-10-23 03:31:20

最好的选择是安装程序包中的自定义脚本位,用于检查权限,然后根据该信息运行命令。

在服务器操作系统上,这不是必需的,因为应用程序组的默认用户将位于 IIS_WPG 中并且具有临时目录的权限。 Windows XP 的 IIS 版本有缺陷,它是非标准的,并且不遵循所有规则。如果您预期的部署环境是 Windows Server 2003 或更高版本,那么您的安装程序应该按原样运行。

Your best bet is a custom bit of script in the installer package that checks permissions and then runs the command based on that information.

On a server OS this shouldn't be necessary since the default user for the application group will be in the IIS_WPG and have permissions to the temp directories. Windows XP has a bugged up version of IIS that is non-standard and doesn't follow all the rules. If your expected deployment environment is Windows Server 2003 or better then your installer should work as-is.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文