【问题标题】:Need help configuring IIS6 to run ASP.net 2 Application需要帮助配置 IIS6 以运行 ASP.net 2 应用程序
【发布时间】:2011-08-11 21:01:48
【问题描述】:

我有一台 Windows 2003 服务器。

我主要在上面运行 ASP Classic 网站。我将它们配置为默认网站下的虚拟目录,因此可以通过http://TheWebServer/TheOnlineApp 访问它们。我使用 ASP.net 创建了一个新站点,并将其设置为虚拟目录。

在默认网站的 ASP.NET 选项卡上,我的版本选择是 1、2 和 4。因为我在 Oracle 中运行查询,所以我需要将其作为 ASP.Net 2 运行。

我无法将它们作为 ASP.net 4 运行,因为 Oracle 驱动程序不包含在 4 中,我可以从 Oracle 获取驱动程序,但是我们使用的是旧版本的 Oracle,新版本的 oracle 不是那个远向后兼容。

如果我将虚拟目录的 ASP.net 版本更改为 2,并将默认设置为 4,则会收到 404 错误:

The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.
Requested URL: /TechCallCenter/eurl.axd/4e68f64d4066d244a27da9fff7bf3f0d/

但是,我可以通过名称访问特定页面,而不是依赖于默认文档。 另外,在我得到的所有其他虚拟目录上:

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."

而且我无法访问我的任何 ASP 经典虚拟目录。

如果我将默认站点和我试图开始工作的虚拟目录上的版本都更改为 2,那么我的所有页面都可以访问,但我在尝试连接到 Oracle 数据库时遇到错误

[Exception: OCIEnvCreate failed with return code -1 but error message text was not available.]
System.Data.OracleClient.OciHandle..ctor(OciHandle parentHandle, HTYPE handleType, MODE ocimode, HANDLEFLAG handleflags) +363
System.Data.OracleClient.OciEnvironmentHandle..ctor(MODE environmentMode, Boolean unicode) +23
System.Data.OracleClient.OracleInternalConnection.OpenOnLocalTransaction(String userName, String password, String serverName, Boolean integratedSecurity, Boolean unicode, Boolean omitOracleConnectionName) +122
System.Data.OracleClient.OracleInternalConnection..ctor(OracleConnectionString connectionOptions) +135
System.Data.OracleClient.OracleConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) +36
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +68
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +519
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +104
System.Data.OracleClient.OracleConnection.Open() +37
ScratchPad.Button1_Click(Object sender, EventArgs e) +235
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5087

在我的开发机器上一切都很好,但是,它是一台 Windows 7 计算机,所以 IIS 的界面是完全不同的。

【问题讨论】:

    标签: asp.net oracle iis iis-6


    【解决方案1】:

    我的猜测是您在同一个进程中使用了多个版本的 .Net CLR(1.1、2.0 或 4.0),这在 IIS6 中并不能很好地工作。

    创建一个仅用于运行 .Net 2.0 应用程序的新应用程序池。然后通过虚拟目录属性对话框中的虚拟目录->应用程序池设置分配虚拟目录以使用它。完成此操作后,您可以将父网站设置回其使用的设置。

    还请记住,虚拟目录可以从其父级的 web.config 值继承设置,因此请根据需要使用重置(如 <connectionStrings><clear /></connectionStrings>)。

    我还建议将其移至它自己的网站,如果这将在您的环境/网络中工作,并由新的 IP、域名或端口分隔。没什么大不了的,因为您应该能够让虚拟目录在您的情况下工作,但它可以为您简化事情。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-04-13
      • 1970-01-01
      • 1970-01-01
      • 2015-11-12
      • 2011-04-27
      • 2021-02-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多