【问题标题】:ASP.NET 2.0 files work in one folder, but NOT in anotherASP.NET 2.0 文件在一个文件夹中工作,但不在另一个文件夹中
【发布时间】:2011-01-27 10:29:22
【问题描述】:

我为客户端创建了一个 ASP.NET 应用程序,所有文件都在其 D 盘上的一个文件夹中。

现在是时候开始生产了,所以我将所有文件和文件夹复制到同一驱动器上现有的经典 ASP 文件夹中。

当我浏览到应用程序时,它无法启动。

我能看到的唯一区别是开发站点不像生产站点那样需要 HTTPS。

我还确保两个文件夹的所有权限都相同。 我还使用 aspnet_regiis 工具确保 GAC 具有读取权限。

我的调试知识已经结束了,有人可以帮帮我吗。

这是我从应用程序事件日志中得到的错误消息。

Failed to initialize the AppDomain:/LM/W3SVC/3/Root

Exception: System.Configuration.ConfigurationErrorsException
Message: Exception of type 'System.Configuration.ConfigurationErrorsException' was thrown.
StackTrace:    at System.Web.Configuration.ErrorRuntimeConfig.ErrorConfigRecord.System.Configuration.Internal.IInternalConfigRecord.GetLkgSection(String configKey)
   at System.Web.Configuration.RuntimeConfigLKG.GetSectionObject(String sectionName)
   at System.Web.Configuration.RuntimeConfig.GetSection(String sectionName, Type type, ResultsIndex index)
   at System.Web.Configuration.RuntimeConfig.get_HostingEnvironment()
   at System.Web.Hosting.HostingEnvironment.StartMonitoringForIdleTimeout()
   at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters)
   at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters)
   at System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironment(String appId, IApplicationHost appHost, HostingEnvironmentParameters hostingParameters)
   at System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironmentAndReportErrors(String appId, IApplicationHost appHost, HostingEnvironmentParameters hostingParameters)

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

------------------------
Failed to execute the request because the ASP.NET process identity does not have read permissions to the global assembly cache. Error: 0x80131902 

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
-------------------------

aspnet_wp.exe  (PID: 4568) stopped unexpectedly.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

这是网络错误消息:

Server Application Unavailable 
The web application you are attempting to access on this web server is currently unavailable.  Please hit the "Refresh" button in your web browser to retry your request. 

Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur. 

感谢您的帮助,

史蒂夫

【问题讨论】:

  • 只是为了确保您没有错过显而易见的事情:您确定您已经激活了 IIS 中的 ASP.NET(和正确的版本)吗?您是否将该文件夹设置为应用程序,或者至少是一个虚拟目录?
  • 是的,我有,我将文件复制到的应用程序是一个经典的 ASP 应用程序,我确保在选项卡中启用了 ASP.NET 2.0。谢谢你的建议。

标签: asp.net iis-6 permissions frameworks asp.net-2.0


【解决方案1】:

一些值得检查的事情:

  • 文件夹权限,以确保 IIS 工作进程有权访问文件所在的文件夹
  • 如果文件在文件夹中 - 该文件夹在 IIS 中设置为虚拟目录,并且您已单击 IIS 控制面板中的创建按钮来创建应用程序。

【讨论】:

  • 我已经完成了所有这些工作,实际上我做得太过火了,让每个人都可以完全访问所有文件夹,只是为了看看我是否可以让它工作,而没有。我不知道该怎么做。为什么一个文件夹可以工作而另一个文件夹不工作?
【解决方案2】:

您是否确保工作进程帐户配置正确。尝试在C:\Windows\Microsoft.NET\Framework\v2.0.50727 文件夹中运行以下命令:

aspnet_regiis -ga <worker_process_account_name>

【讨论】:

  • worker_process_account_name 是应用运行的账户吗?那会是 ASPNET 帐户吗?抱歉,我之前从未真正处理过这个问题。
  • @steve - 1. 打开网站属性并单击“主目录”选项卡。注意“应用程序池”的名称(它是一个下拉列表框)。 2. 打开 IIS 管理器树的应用程序池节点,浏览到 (1) 中记下的应用程序池。右键单击并打开应用程序池属性,然后单击身份选项卡。正在使用什么身份?
  • 他们使用 IIS 6.o,没有应用程序池。非常感谢您的帮助。我想知道如何解开这个谜。
  • @Steve - 一定有吗?还是他们在 IIS5 兼容模式下运行 IIS6?
【解决方案3】:

感谢大家的所有建议和帮助。由于没有任何效果,对我来说毫无意义,我决定重新安装框架,现在一切都很好。

史蒂夫

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-09-20
    • 2019-02-21
    • 1970-01-01
    • 1970-01-01
    • 2022-01-09
    • 1970-01-01
    • 2014-02-10
    • 2020-07-30
    相关资源
    最近更新 更多