I have a Windows 2003 server.
I am mostly running ASP Classic websites on it. I have them configured as virtual directories under the default web site, so they are accessible as http://TheWebServer/TheOnlineApp. I have created a new site using ASP.net and also set that up as a virtual directory.
On the ASP.NET tab for the Default Web Site, my version choices are 1, 2 and 4. Because I am running queries in Oracle, I need to run it as ASP.Net 2 .
I cannot run them as ASP.net 4, because the Oracle drivers are not included in 4, I could get the drivers from Oracle, but with old version of Oracle that we are using, the new version of oracle is not that far backwards compatible.
If I change the ASP.net version for the virtual directory to 2, and leave the default as 4 then I get a 404 error:
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/
But, I can access specific pages by name rather than depending on the default document. Plus, on all my other virtual directories I get:
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."
And I am unable to access any of my ASP classic virtual directories.
If I change version to 2 on both the default site and the virtual directory that I am trying to get to work, then all my pages are accessible, but I get errors trying to connect to the Oracle database
[Exception: OCIEnvCreate failed with return code -1 but error message text was not ava开发者_开发技巧ilable.]
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
Everything works great on my development machine, but, it is a Windows 7 computer, so the interface for IIS is completely and totally different.
My guess is that you're using multiple versions of the .Net CLR (1.1, 2.0, or 4.0) in the same process, which doesn't work real great in IIS6.
Create a new Application Pool that you will only use to run .Net 2.0 apps. Then assign the Virtual Directory to use it via the Virtual Directory->Application pool setting in the Virtual Directory Properties dialog. After you do this, you may set the parent Web Site back to the settings it was using.
Also remember that Virtual Directories can inherit settings from their parent's web.config values, so use resets (like <connectionStrings><clear /></connectionStrings>
) as necessary.
I also suggest moving it to it's own Web Site if that will work in your environment/network separated by a new IP, domain name, or port. Not a big deal since you should be able to get Virtual Directories to work in your case, but it could simplify things for you.
精彩评论