混合网站和虚拟目录之间.NET版本的"服务器应用程序不可用"错误信息

混合网站和虚拟目录之间.NET版本的"服务器应用程序不可用"错误信息

问题描述:

背景故事结果
上个月,我们的开发团队创造了一个新的asp.net 3.5的应用程序放置了我们的生产网站。一旦我们的工作完成后,我们要求从管理的服务器应用程序进行复制到我们的生产基地,并配置虚拟目录作为新的应用程序组。

Backstory
Last month our development team created a new asp.net 3.5 application to place out on our production website. Once we had the work completed, we requested from the group that manages are server to copy the app out to our production site, and configure the virtual directory as a new application.

在12/27/2010,二公Gineau猪'被选择使用的应用程序,和它的工作太棒了。
在12/30/2010,我们通过内部员工接到通知,即当工作人员试图访问应用程序(这是业务流程所有者),他们收到了服务器应用程序不可用的消息。

On 12/27/2010, two public 'Gineau Pigs' were selected to use the app, and it worked great. On 12/30/2010, We received notification by internal staff, that when that staff member tried to access the application (this was the Business Process Owner) they recieved the 'Server Application Unavailable' message.

当我打电话,做我们的服务器支持小组,我被告知,它可能失败,因为我没有在我的code关闭连接。然而,同组进去,然后创造了这个延期请求申请一个独立的应用程序池。因为它没有问题

When I called the group that does our server support, I was told that it probably failed, because I didn't close the connections in my code. However, the same group went in and then created a separate app pool for this Extension Request application. It has had no issues since.

我做了一点谷歌搜索,因为我不喜欢被人指责的事情。我发现,服务器应用程序不可用的消息也将出现,当你有使用不同的框架多个应用程序,你不把它们放在不同的应用程序池。

I did a little googling, since I do not like being blamed for things. I found that the 'Server Application Unavailable' message will also appear when you have multiple applications using different frameworks and you do not put them in different application pools.

技术细节 - 树我们的网站结构

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

从我们的服务器支持小组:

发表的服务器日志和IIS网站的设置。不得不重置应用程序池,因为它不能正常工作。这纠正了网站,现在是重新联机。我们说干就干,开创了网络推广一个应用程序池,所以它从主站点池隔离。在过去,我们已经看到了其他的应用程序做到这一点时,有被打开的连接和池填满。建议审查现场code,以确保没有连接保持打开。

真正的问题:
是什么导致了失败?是不是该连接保持打开的问题一个ASP经典问题?不会的ExtensionRequest应用程序已经被使用(两倍以上),首先要有敞开的连接?难道是更有可能失败是由于他们没有打扰设置在第一时间在自己的应用程序池的新的应用程序引起的?

The Real Question: What really caused the failure? Isn't the connection being left open issue an ASP Classic issue? Wouldn't the ExtensionRequest application have to be used (more than twice) in the first place to have the connections left open? Is it more likely the failure is caused by them not bothering to setup the new Application in it's own App Pool in the first place?

很抱歉的长期windedness

您会很需要获取并查看服务器的应用程序和放大器;对于服务器报告这些错误时期系统事件和HTTPERR日志。

You'd really need to obtain and review the server's Application & System event and HTTPERR logs for the period the server was reporting these errors.

如果没有这些它会是很难猜测什么是问题的根源。

Without these it'd be hard speculate what was the root cause of the problem.

更新:

OP错误地标示了他的问题,以便在下一个部分不再适用。不过,我会留在原地,因为我认为,信息是为那些遇到这些问题,或许考虑迁移到IIS7.x.有用



你是正确的运行两个不同的.NET框架的同一应用程序池可能导致这些错误,但是这东西你往往会看到在Windows 2003 / IIS6,而不是Windows 2008 / IIS7。

OP incorrectly tagged his question so this next section no longer applies. However I'll leave in place because I think the information is useful for those encountering these issues and perhaps thinking about migrating to IIS7.x.


You are correct that running two different .NET Framework's in the same application pool can cause these errors but that's something you'd tend to see on Windows 2003/IIS6, not Windows 2008/IIS7.

IIS7采用了略有不同的方法来指定.NET Framework版本加载它和它的应用程序池的 managedRunTimeVersion 属性决定。当请求由IIS / ASP.NET网站的处理程序映射的使用处理过的 preCondition 属性来确定何时加载必要的处理(这有点像一个脚本映射在IIS中的previous版本)。

IIS7 uses a slightly different approach to specifying which .NET Framework version is loaded and it's determined by the Application pool's managedRunTimeVersion property. When requests are processed by IIS/ASP.NET the site's Handler Mapping's use a preCondition attribute to determine when to load the requisite handler (which is kind of like a script mapping in previous versions of IIS).

此机制prevents不正确的运行时的版本被加载到应用程序池的工作进程。

This mechanism prevents the incorrect runtime version being loaded into the application pool's worker process.

因此​​,如果一个应用程序池配置为运行.NET Framework版本V4.0仅该版本将加载,即使你的应用是建立针对2.0版。

So if an application pool is configured to run .NET Framework version v4.0 only that version will load, even if your application is built against v2.0.

有一个关于如何在这里工作有很大的文章:

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

ACHTUNG! IIS7 preconditions

大约一​​半的处理程序,通过部分解释了为什么不小心装错.NET版本到水池里的危险是由 preCondition 功能缓解。

The section on Handlers about half way through explains why the dangers of accidentally loading the wrong .NET version into a pool are mitigated by the preCondition feature.

一个服务器应用程序不可错误通常意味着什么灾难性情况(如错误的ASP.NET版本的ISAPI筛选器加载到一个已经运行的工作进程)。

A Server Application Unavailable error usually means something catastrophic has happened (like loading the wrong ASP.NET version's ISAPI filter into an already running worker process).

不关闭SQL连接是不太可能导致这种类型的严重错误的。你最好很可能会看到死亡运行时错误的黄色画面,如果是这样的话了。暗战SQL连接,使变形,整个服务上衣本身通常不弯ASP.NET。

Not closing SQL connections is unlikely to cause this type of serious error. You'd more than likely be seeing a yellow screen of death runtime errors if that were the case. Running out of SQL connections usually doesn't bend ASP.NET so out of shape that the whole service tops itself.

我的主要嫌疑人将是一个权限问题,即应用程序池标识无法正确地访问应用程序的文件夹。但它只是一种预感。

My prime suspect would be a permissions problem where the application pool identity was unable to correctly access the application folders. But it's just a hunch.

同样,你需要做的就是让应用与放大器;系统事件日志和日志HTTPERR(它们驻留在%SYSTEMROOT%\\ SYSTEM32 \\ LogFiles文件\\ HTTPERR 。这将包含有关什么地方出了错线索和事实。

Again, what you need to do is get the Application & System event logs and the HTTPERR logs (they reside in %systemroot%\System32\LogFiles\HTTPERR. That will contain clues and facts about what went wrong.

更新2:

在Windows 2003 / IIS6,如果您有运行驻留在同一池中不同的ASP.NET版本的两个应用程序,你的将会的得到这个错误。根据我的经验(我的网络托管商工作)正是这个臭名昭著的错误页面的首要原因:

On Windows 2003/IIS6, if you have two applications running different ASP.NET versions that reside in the same pool you will get this error. In my experience (I work for a web hoster) it is the primary cause of this infamous error page:

有也记录到应用程序事件日志泄密事件:

There's also a tell-tale event logged to the Application Event log:


Event Type: Error
Event Source:   ASP.NET 2.0.50727.0
Event Category: None
Event ID:   1062
Date:       12/01/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.

虽然你的根应用程序可能无法在ASP.NET编写很可能是事情已经引发了不同版本的框架加载到你的网站的应用程序池。

Whilst your root application may not be written in ASP.NET it's likely that something has triggered loading of a different version of the framework into your site's application pool.


  • 有一个无赖的web.config 根......这将触发ASP.NET加载

  • 有一个通配符映射到ASP.NET 1.1站点脚本映射(不太可能,但可能)

  • there's a rogue web.config in the root...this will trigger ASP.NET to load
  • there's a wildcard mapping to ASP.NET 1.1 in the site script maps (less likely, but possible)

我倾向于认为,新应用程序肯定在其他网站或应用程序正在运行一个不同的框架版本游泳池结束了。要真正找出的唯一方法是获取应用程序事件日志,看看上面显示的事件。

I'm inclined to think that your new application most certainly ended up in a pool where other sites or applications were running a different framework version. The only way to really find out is to obtain the Application event logs and look for the event shown above.