ASP Error and IIS 7.0 - iis-7

In IIS 6 ASP errors were displayed with the line number and a description of the problem. For example,
{call dbo.spGetCommunityInfo(xx)}
Microsoft SQL Native Client error '80020005'
Invalid character value for cast specification
/communitydetail.asp, line 42
IIS 7 changes the way ASP errors are handled and displays something a lot less helpful. For example,
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request
Does anyone know what configuration changes are required to get the behavior of IIS 6 in IIS 7?

You can use AppCmd to turn on ScriptErrorSentToBrowser (it's false in IIS7 defaults, it was true in IIS6). AppCmd live in %SystemRoot%\system32\inetsrv and you need to run it as admin:
appcmd.exe set config
-section:system.webServer/asp -ScriptErrorSentToBrowser:true

Related

same C# code doesn't work on different server with same IIS version

I have a Windows Server R2 Standard Service pack 1 with IIS version 6.1 (built 7601 service pack 1 ) in this server I have like 15 web applications, this webserver works very well, but I tried to make a backup server for a while now, I setup several servers with the same configuration, but some of the applications doesn't work in the new servers.
all have the same asp.Net version v4.0.30319
I believe I have a lot experience with IIS and servers, but seems like I'm missing something, the error that I got :
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.
Source Error:
Line 43:
Line 44:
Line 45:
Line 46:
Line 47:
Source File: C:\inetpub\wwwroot\DEPLOYED-PRODUCTION\portal_versions\portal_production\web.config Line: 45
After I remove the "targetFramework="4.0" more errors appeared.
Its frustrating, I check the servers one by one , make sure they have same configuration, but application still doesn't work.
my next step will be make modifications on the code itself.
but, why same code doesn't work on similar servers?
How can I get the specifications on IIS all the info, I know that is version 6 and the asp.net is v4.0.30319 , but should be more details that tell me where is the difference?

How to get IIS 8.5 to send detailed error messages?

We are trying to run a classic .asp application on Windows 2012 IIS 8.5. ASP scripts work in general but when there is an error (e.g. include missing or syntax) then we simply see:
An error occurred on the server when processing the URL. Please contact the system administrator.
If you are the system administrator please click here to find out more about this error.
This although we have enabled detailed error messages on the site and regardless of whether we run the application remotely or via localhost.
We want to know which script and line of code is causing the problem.
We've also tried routing 500 errors to an error handling .asp page which can provide error details to no avail.
PS: There also seems to be no "ASP" feature so no way to enable debugging or the like.
Please carefully follow below steps:
Step 1: Check Classic ASP is installed on your server
http://www.iis.net/learn/application-frameworks/running-classic-asp-applications-on-iis-7-and-iis-8/classic-asp-not-installed-by-default-on-iis
https://www.youtube.com/watch?v=MTeBnLzP_FY
Double click "ASP" in middle section under IIS
Enable Parent Paths: True
http://www.iis.net/learn/application-frameworks/running-classic-asp-applications-on-iis-7-and-iis-8/classic-asp-parent-paths-are-disabled-by-default
Step 2: Check IIS setting
Select your website under IIS -
Goto "Edit Permissions..." under Actions pane (top right)
Make sure that folder has correct permissions
Step 3: Application Pool
Goto application pool in IIS manager
Select application pool used by Classic ASP website
Under Advance settings
.Net Framework Version : v2.0
Enable 32-Bit Applications: True
Managed Pipeline Mode: Integrated
Identity: NetworkService
This steps resolved issue for me.
Thanks to #Keith for the useful tip. The missing key in my case was the icon for the ASP feature. You have to start the IIS Manager using "Run as Administrator" before you see this. Once you have that you can enable "Send Errors to Browser" as described in the link provided above: https://stackoverflow.com/a/5912873/65775

Site configured on IIS 8 classic mode - unable to read configuration file

A web site of ours, designed using WCSF design pattern, using MS Practices library, worked fine while configured in IIS 6. We migrated the app to new server with IIS 8. Site didn't work in the Integrated Mode as it was unable to fetch the logged on user Context. Hence we changed to "Classic mode" and the site started to work.
Now we get the following error in the site
"'Cannot read configuration file 'trying to read configuration data from file '\?\', line number '0'. The data field contains the error code"
We have to restart the server if we receive the error.
I want to know if this is the problem in using the "Classic mode" in IIS 8 or any other problem. IIS event viewer doesn't give more than the error mentioned above.
Please help if any other configuration needs to be done or am I missing something here.

Classic ASP on Windows Server 2003

After I configure everything (IIS, Websites, permissions) on newly installed virtual server, I get this error when run the default.asp file.
Server object error 'ASP 0177 : 800401f3'
Server.CreateObject Failed
/default.asp, line 30
I found ASP 0177 post very useful. But I can't seem to solve it. It give a solution like this
A: This error means "Invalid class string" -- in other words the call to CreateObject failed because the name object cannot be found by the OLE sub-system. Causes include:
1. You really didn't run regsvr32 on the server after all.
2. You ran regsvr32 but it reported an error.
3. Someone modified security on part of the registry that's preventing the OLE subsystem from reading all or part of the HKEY_CLASSES_ROOT tree.
4. The name of the object you are trying to create was mispelled or is incorrect.
5. Determine if it's a permissions problem
6. Determine if it is a file permissions problem:
7. Check registry permissions
Which service do I have to register? Isn't ASP automatically installed on Server 2003 when install IIS? If not what setting do I need to change? This is a freshly installed Virtual Windows Server 2003?
EDIT: I think this link might work but not sure ASP Win Svr 2003
EDIT2: Code:
Set BACSE = Server.CreateObject("NAICSCodeSE2_1_0.Engine")
If Session("DEBUG") = "TRUE" then Response.Write "BACSE Debug="&BACSE.SetDebugMode(True)&"<BR>"
Custom COM component first need to Register in Server with below command, before using it in classic ASP page.
regsvr32 yourcomdllfile.dll

Why is my IIS 7 refusing to serve up css or js when I change 'Enable 32-Bit Applications' to False

I have a very simple web application (asp.net MVC3, .net 4, using IIS not Visual Studio's embedded server, 64-bit Windows 7). When I change the settings in the application pool for my application and set 'Enable 32-Bit Applications' to False, my application's view shows up, but none of the static content (Content/Site.css or Scripts/myScript.js) shows up. Instead, I get status code 500 on those requests.
HTTP Error 500.0 - Internal Server Error
The page cannot be displayed because an internal server error has occurred.
The reason I'm changing this value is that I'm trying to use the 64-bit Oracle.DataAccess.dll and if I have this value set to True it causes the application pool to run in WOW64 mode and it tries to load the dll with the wrong format.
I've searched online for a while and can't find very much info about this. I've tried playing with permissions on the files, I've tried running aspnet_regiis with all kinds of flags. I'm out of ideas. Why won't IIS serve up this static content when running in 64bit mode?
When I had this error there was a problem in system.webServer\staticContent in web.config.
Because of a difference between servers, an for a particular MIME type was required on one machine but caused this error on another.
The failsafe would be to include a for each that you have in web.config to avoid getting a 500 if the is not required.
It is very likely that on your IIS setup, a 32 bit only module is installed by you accidentally which prevents the whole web application from running in 64 bit module. That's a common cause of such 500 errors.
Failed request tracing should be able to show you more information on which module it is,
http://www.iis.net/learn/troubleshoot/using-failed-request-tracing/troubleshooting-failed-requests-using-tracing-in-iis
Double check mime types are correctly assigned, it could be because you have double entry of mimetypes for local site web.config and server itself.
Having to put comment here as I dont have enough points to comment.
Have you tried checking the handler mapping on your website.
Under Handler Mappings: Check that the StaticFile Handler is still registered and that the path is assigned to *
Also check that it is enabled.
Just had this issue myself with windows security enabled and ananamous access turned off.
The solution in my case was to add the localhost site to my local intranet sites. Running Visual Studio in adminstrator mode can also clear the problem.

Resources