Mixing .NET versions between website and virtual directories and error message "server application unavailable"

Background
Last month, our development team created a new asp.net 3.5 application for posting on our website. As soon as we completed work, we asked the group that manages the server to copy the application to our production site and configure the virtual directory as a new application.

On 12/27/2010, two publicly available “Gineau Pigs” were selected to use this application, and it worked perfectly. 12/30/2010 We received a notification from internal employees that when this employee tried to access the application (it was the owner of the business process), they received the message "Server application is unavailable."

When I called the group that supports our server, I was told that it probably failed, because I did not close the connections in my code. However, the same group entered and then created a separate application pool for this application with an extension request. Since then he has had no problems.

I did a bit of searching because I don’t like being blamed for things. I found that the “Server Application Unavailable” message will also appear if you have multiple applications using different frameworks and you do not put them in different application pools.

Technical details - Tree structure of our site

Main Website <-- ASP Classic +-Virtual Directory(ExtensionRequest) <-- ASP 3.5 

In our server support group:

'Viewed server logs and website setup in IIS. To reset the application pool because it did not work properly. This adjusted the website, and now it's back on the Internet. We went ahead and created an application pool for the extension website, so it is isolated from the main site pool. Previously, we saw another application, when this connection remained open, and the pool was full. Recommend looking at the site code to make sure connections are not open. ''

The real question: What really caused the failure? Isn't communication an open issue? Should I use the ExtensionRequest app (more than two times) to open the link? Most likely, the failure was caused by the fact that they did not bother to configure a new application in their own application pool in the first place?

Sorry for the long winding

+4
source share
2 answers

You really need to get and view server applications and system events and HTTPERR logs for the period when the server reported these errors.

Without this, it would be difficult to guess what was the main cause of the problem.

Update:

The OP is incorrectly marked with its question, so the next section no longer applies. However, I will go away because I think that this information is useful for those who are faced with these problems and may be thinking about switching to IIS7.x.


You are correct that running two different .NET Framework in the same application pool can lead to these errors, but this is what you usually see in Windows 2003 / IIS6, and not in Windows 2008 / IIS7.

IIS7 takes a slightly different approach to indicating which version of the .NET Framework is loaded and is determined by the property of the managedRunTimeVersion application managedRunTimeVersion . When requests are processed by IIS / ASP.NET, the preCondition attribute is used to map the site handler to determine when to load the handler of the required value (which is similar to the script mapping in previous versions of IIS).

This mechanism prevents the loading of an incorrect execution version into the application pool workflow.

So, if the application pool is configured to run the version of the .NET Framework version 4.0, then only this version will load, even if your application is created against v2.0.

There's a great article on how this works here:

Achtung! IIS7 Prerequisites

About halfway through the Handlers section explains why the risk of accidentally loading the wrong version of .NET into a pool is mitigated by the preCondition function.

Server issue. An inaccessibility error usually means that something catastrophic has happened (for example, loading the wrong ASPAP filter of the ISAPI version into an already running workflow).

Not closing SQL connections is unlikely to cause this type of serious error. Most likely, you will see a yellow runtime error screen, if so. Starting from SQL connections does not usually bend ASP.NET so that the entire structure is itself a vertex.

My main suspect would be a permission issue when the application pool identifier was unable to correctly access the application folders. But this is just a hunch.

Again, you need to get application and system logs and HTTPERR logs (they are in %systemroot%\System32\LogFiles\HTTPERR ). It will contain clues and facts about what went wrong.

Update 2:

On Windows 2003 / IIS6, if you have two applications with different versions of ASP.NET that are in the same pool, you will get this error. In my experience (I work in a web host) this is the main reason for this notorious error page:

alt text

The control event is also recorded in the application event log:

  Event Type: Error
 Event Source: ASP.NET 2.0.50727.0
 Event Category: None
 Event ID: 1062
 Date: 01/12/2011
 Time: 12:31:43
 User: N / A
 Computer: KK-DEBUG
 Description:
 It is not possible to run two different versions of ASP.NET in the same 
 IIS process.  Please use the IIS Administration Tool to reconfigure your
 server to run the application in a separate process.

Although your root application cannot be written in ASP.NET, it is likely that something started loading another version of the framework into the application pool of your site.

  • There is a rogue web.config root ... this will cause ASP.NET to load
  • there is a lookup mapping in ASP.NET 1.1 on the sitemap script (less likely, but possible)

I am inclined to think that your new application probably fell into the pool, where other sites or applications ran a different version of the framework. The only way to find out is to get the application event logs and see the event shown above.

+2
source

Hard to say; there can be many reasons (too many resources used, a call outside of .NET caused a crash, etc.). I would look in the event log and see if something can be found there.

If you use different versions of .NET, you definitely need separate pools. If you have this option, I would recommend separate pools for each application (even in the same version of .NET).

Regarding "closing the connection" (I assume that you mean connecting to the database). If you create "low-level" connections (i.e. SqlConnection, SqlCommand), make sure that you wrap them in "use", otherwise the connection pool may fill up. However, in my experience, in this case you should get regular .NET errors. If you use ORM, this should not be a problem.

Edit:

If you cannot find anything useful in the event log, you can try the following: http://learn.iis.net/page.aspx/266/troubleshooting-failed-requests-using-tracing-in-iis-7/

0
source

Source: https://habr.com/ru/post/1334663/


All Articles