Reputation: 231
We have migrated an application written in classic asp to Azure websites (shared) and some pages simply give the error "The page cannot be displayed because an internal server error has occurred." with out any details. These pages work fine under IIS 7 or using IIS express. How ever on Azure website they do not.
As suggested in some other posts I have configured the following for the website on Azure:
1) Web Server Logging - ON
2) Detailed Error Messages - ON
3) Web.config - customErrors mode to off.
<customErrors mode="Off"/>
<compilation debug="true" targetFramework="4.0">
Still the log messages do not provide any more details what is wrong and simply gives the following information:
Detailed Error Information:
Module IsapiModule
Notification ExecuteRequestHandler
Handler ASPClassic
Error Code 0x00000000
Any help is appreciated how to debug the classic asp pages issues on Azure websites. Thank you.
Upvotes: 9
Views: 51013
Reputation: 355
To make the detailed error messages be sent to the browser you need to enable the scriptErrorSentToBrowser attribute as below.
<system.webServer>
<asp scriptErrorSentToBrowser="true" />
</system.webServer>
It goes without saying this could be a potential security risk so shouldn't be left enabled!
Upvotes: 1
Reputation: 1071
If you're trying to configure your site where you don't have access to IIS, such as an Azure Web App, you can configure Classic ASP settings in the Web.Config.
Under
<system.webServer>
You can place an
<asp>
element which configures various things with how Classic operates.
The property which was affecting my site was
**appAllowDebugging="true"**
While this property is fine and dandy when you're developing with Visual Studio and have a Just-In-Time debugger installed, it messes up the error handling for Classic Asp.
BTW, took me forever to figure out what I changed.
Upvotes: 1
Reputation: 51
I solved it by turning on the Application log under Logging => Diagnostics log in the Azure web app configuration.
You can then see the error in the "Log stream" pane and fix it.
In my case the error where the following two lines in the web.config
:
<add name="ExtensionlessUrlHandler-Integrated-4.0"
path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler"
preCondition="integratedMode,runtimeVersionv4.0"/>
<remove name="ExtensionlessUrlHandler-Integrated-4.0"/>
I removed them and it worked again.
Upvotes: 0
Reputation: 29201
One (odd) thing to try, which worked for me:
Try FTP'ing onto your Azure website, and rename your web.config
to something completely different.
I renamed mine to web.config2
- the Azure "The page cannot be displayed because an internal server error has occurred."
error message disappeared, and my ASP.Net application burst into life again.
From there, I recreated the web.config from scratch, copying chunks of it from my original version, piece by piece (to see what was causing the problem)
Yeah, I know... it's a dumb suggestion, but Azure was giving me no hints about what was causing the error, even with logging turned on, and this saved my sanity !!
Upvotes: 7
Reputation: 231
Thank you G. Stoynev! It worked after adding the custom error asp page! I used the code from the following link to create custom error asp page
http://support.microsoft.com/kb/224070
Also the following link as well helped http://www.tacticaltechnique.com/web-development/classic-asp-getlasterror-in-iis7/
Now the system.webServer section in my web.config looks as follows:
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules runAllManagedModulesForAllRequests="true"/>
<httpErrors>
<remove statusCode="500" subStatusCode="100" />
<error statusCode="500" subStatusCode="100" prefixLanguageFilePath="" path="/errors.asp" responseMode="ExecuteURL" />
</httpErrors>
</system.webServer>
Upvotes: 12
Reputation: 7791
You problem might be on the browser side: make sure that the IE setting to "show friendly messages" is turned off
Also, on the server side, you must have some setting to allow error messages to be sent to client (sorry, I only have access to the IIS flavor of that setting... not sure what's in Azure):
Upvotes: 0