HTTP Error 500.24 - Internal Server Error An Asp.NET setting has been detected that does not apply in Integrated managed pipeline mode - iis

I have webpage which has gridview, one of the columns will have a image. When clicked on image it will open the PDF saved on the web server. It was working fine but I am getting below error
"HTTP Error 55.24 - Internal Server Error An Asp.NET setting has been detected that does not apply in Integrated managed pipeline mode."
I googled and did as suggested in HTTP Error 500.22 - Internal Server Error (An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.) made sure application pool is classic and webconfig is correct but still I am getting that error when clicked on image which has to open the saved PDF... please help....

Your error is specifically to do with 'client impersonation'. I had the same error on one machine but not on another. By comparing settings I worked out the difference.
Start IIS Manager. Select the server in the left pane and double click 'Authentication' under the IIS group in the central pane. Select ASP.NET Impersonation and select 'Disable' at the top of the right pane.

please add web.config
<configuration>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
</system.webServer>
</configuration>

I changed in my application pool running the site.
"Managed Pipline Mode" from integrated to classic.
right click on your application pool -> basic settings.

One may get this error when accessing a wrong path (e.g., on the url parameter of an Ajax call), even though all of the other answers suggestions were handled.
For the correct usage of (relative) paths, see this answer.

Your error is specifically to do with 'client impersonation'. I had the same error on one machine but not on another. By comparing settings I worked out the difference.
Start IIS Manager. Select the server in the left pane and double click 'Authentication' under the IIS group in the central pane. Select ASP.NET Impersonation and select 'Disable' at the top of the right pane.
Then, select the virtual directory and select the 'Authentication'. Anonymous Auth gonna be 'Enabled'

Related

503 error, caused by `iis_ssi.dll failed to load` in the Event Viewer (eventlog)

I'm getting this error in the event log (EventViewer):
The Module DLL C:\Windows\System32\inetsrv\iis_ssi.dll failed to load. The data is the error.
OS is Windows2012 Server. How to fix it?
You need to add SSI in Server Manger. Follow these steps:
Add Roles and Features
In Server Roles, expand Web Server (IIS)
Expand Application Development
Select Server Side Includes
For Windows 2012r2 Operating systems, to be more precise following this step:
Open Server Manager Dashboard
Click on Add Roles and Features
Expand Web Server IIS (if not already selected)
Expand Web Server
Expand Application Development and ensure that all unchecked boxes are selected.
Click Next on the select feature windows to advance
In the Confirm installation selection select specify an alternate source path for the installation CD such as F:\sources\sxs to complete the installation.

Applicationhost.config is missing

I've been encountering this problem whenever I try adding a role to my Azure Cloud Project.
The thing is that whenever I update to an older revision of my code, it works fine. It isnt until I try adding a new role or even removing a role and readding it is when I get an error. Even on new projects I cannot get a role added.
Number of things to check/try:
Set the application pool to ASP.NET 4.0. Make sure the application is set to v4.0 as well. Then restart IIS.
Add the following key to <system.webServer> section of Web.Config:
<modules runAllManagedModulesForAllRequests="true" />
Check that the file %userprofile%\documents\IISexpress\config\applicationHost.config exists and the application has the necessary permissions to access it. (IIS Express)
Check the app pool "run as user" and ensure it has rights to the web site directory.
Try running VS in administrator mode and see if debug works. (right click the shortcut and select "run as administrator".
Failing the above post the contents of the file from step 3.

Most Strange IIS Windows Authentication behavior

I have an ASP.NET website running on Windows Server R2 in a corporate network, using Windows Authentication.
The app pool of the website is using a domain account and in Integrated pipeline mode.
The authentication is set Windows Authentication, all other authentication modes are disabled.
However, this does not work. Every time I access the website, it pops up a dialog asking for user name and password. I enter the correctly domain user name and password, but it does not continue--the windows pops up again. After three times, it fails and displays a white page. I tried with many different browsers, bu all of them fail. I asked some colleagues to try and they all got failure, too.
I cannot figure out why this error is happening and tried many ways to fix it with no luck. I think it is very strange. However, finally I found a way to fix this problem, this is the most strange part of the problem: I edit the "Physical path" in "Basic Settings" of the website, I just point it to another healthy website, for instance, %SystemDrive%\inetpub\wwwroot, then I try to browse the website, very good, it runs well and displays the default page (iisstart.htm). It looks like it is not very helpful, but then I change the physical path back to my website; suddenly everything goes well -- the windows authentication works! I do not know why it helps, but I am happy with this result -- it fixes my problem though I do not know what the heck is happening.
The happy time is always short, several days later, the server got some patches and restarted, the website can't work again. And again, I can fix the problem using the trick above.
I do not like this! I do not like doing this stupid trick every time IIS resets or the server restarts.
Is there anyone who has some ideas on why windows authentication fails, and why the aforementioned trick can fix it, and why after an IIS reset it fails again?
First off, THANK YOU for creating this post. I have the exact same issue and could not find anyone else without posting the obvious fixes that were of no avail to me. I had been working on this for almost two weeks
To assist the next poor soul that encounters this issue and post, I hope my extra tidbits help.
Your initial solution did not fix my issue in my case, but it did prove that it was custom error page related. After pasting in your code into web.config my problem got worse and I was not able to debug or launch the page (had 500 internal server error related to web.config)
BUT finally what I did was go into the IIS Console and remove all of my custom error pages. It still did not work as had hoped. BUT, I also found entries for ASP.NET ".NET Custom Errors" in the top half of the site console (and the "custom errors" tag in web.config). I had old entries in there and removed them via console, and YESSSS, my site came back to normal with Windows Authentication.
I have since recreated the IIS Custom Errors and I am still up and running as designed.
SO to anyone else that may have this issue, check both ASP.NET Custom Errors AND IIS Custom Errors settings. Maybe there is a conflict, I dont know, but in my case having only the IIS pages set fixed me up (for now :-) )
I just found it seems caused by custome 401 error pages under "Error Pages". I set it to execute an URL when the status code is 401 in my web.config, it looks like:
<httpErrors errorMode="Custom">
<remove statusCode="401" subStatusCode="-1"/>
<error statusCode="401" path="/Error/AccessDenied" responseMode="ExecuteURL"/>
</httpErrors>
Then every time I reset IIS and try to access this website, the problem appears. If I delete it in Web.Config or delete from IIS console, then the problem disappears, what is more funny is another experiment: after I deleted this settings and have been successful opening the website, I added this setting back. Everything works very well. Every domain user can access this website, those that failed passing authorization get the customer error page.
So my solution now is I removed this setting in my Web.Config, every time I reset IIS or restart the server, the server admin need to hit the website first, and then add this customer error page in IIS console.
I feel this is a bug of II7.5 on Windows Server 2008 R2.
I was also struggling with this same issue all my day. I am using windows authentication and Custom error setting in web.config for 401 errors.
After I reset the IIS, the website stop accepting domain users and windows authentication pop up reappear again and again.
I added remove tag in the web.config file with Sub status code.
<httpErrors>
<remove statusCode="401" subStatusCode="-1" />
<remove statusCode="401" subStatusCode="1" />
<error statusCode="401" subStatusCode="-1" path="/Custom401.aspx" responseMode="ExecuteURL" />
<error statusCode="401" subStatusCode="1" path="/Custom401_1.aspx" responseMode="ExecuteURL" />
</httpErrors>
Previously remove tag was only present for substatus code -1 but missing for sub status code "1" . After i added it, everything started woking properly.
In the above post, substatus code is missing for error tag, that could be the cause of the problem. There should be remove tag for all 401 errors there.
I just spent a couple of hours digging up a solution to this problem.
Why IE fails yet the other browsers succeed: IE tries to use Kerberos authentication and the other browsers don't try. The others use NTLM.
Solution: In the situation described in the question, a domain account was being used in the App Pool. Simple solution: switch to using the "Network Service" account. More complex solution: You have to register a service principal name (SPN). Read this article (ignore the fact that it is talking about IIS 6 because it also works fine on IIS 7 and 7.5) - You receive an "HTTP Error 401.1 - Unauthorized: Access is denied due to invalid credentials" error message when you try to access a Web site.
I hope this helps. It gave me a headache until I stumbled upon that article. (Thanks to Paul Lynch who posted the link Windows Authentication Failing in IE8 but not Firefox)
I had this same problem on my Windows 2008 R2 server. I did not have custom 401 error pages. I did use aliased server names (via DNS CNAME records and host header entries on the IIS bindings). I registered the SPNs for Kerberos as suggested, but that did not solve the problem. I resolved it by disabling "Kernel Mode Authentication" (click on the server in the IIS tree -> double-click on Authentication under the IIS group -> click on Windows Authentication -> click on Advanced Settings on the Actions pane -> Uncheck the checkbox -> click OK -> run iisreset). The information on that dialog box recommends against disabling Kernel Mode Authentication when using non-standard service accounts for the application pool identity, but that didn't apply to us since we're using the standard ApplicationPoolIdentity identity.
I had the same issue.. Turnes out I should not have messed with my hostfile.. I changed my hostfile and pointed some fancy address to my machine like so:
www.givemeyourcredentials.com 127.0.0.1
I added a binding to the site "www.givemeyourcredentials.com". I typed in the addres in my addressbar and the site prompted my credentials as expected.. Typed in my credentials and got prompted for my credentials again.. And again and again and again..
Turns out: Bind your website to http://localhost when using windows authentication in an IIS site. That did the trick for me.
Hope this helps somebody...
Add "NT Service\trustedInstaller" to physical folder of the site. Location for this user is local machine name.
The NTLM protocol that is used for Integrated Windows authentication requires a two-step process to authenticate clients. The behavior that is mentioned in the "Symptoms" section occurs when the following conditions are true:
The application pool recycles after the first step of the Integrated Windows authentication process.
However, the application pool recycles before the second step of the Integrated Windows authentication process.
To work around this behavior and to reduce the frequency of these error messages, configure the application pool to recycle less frequently. To configure application pool recycling, follow these steps:
Click Start, click Run, type inetmgr, and then click OK.
Expand the name of the computer on which you want to configure application pool recycling, and then expand Application Pools.
Right-click the application pool that you want to configure, and then click Properties.
On the Recycle tab, configure one of the metrics so that IIS recycles less frequently.
Note IIS 6 application pools support several metrics. These metrics include the time elapsed, the number of requests, and the specified time to recycle an application pool. If an application pool has a metric that causes the application pool to recycle frequently, you will experience this issue more frequently.
Click OK.
[ Copied from https://support.microsoft.com/en-us/kb/902160 for posterity ]

Classic ASP on IIS7: refusing to send errors to browser on 500 Internal Server Error

I have classic ASP running on IIS 7.
Even though I configured the ASP "Debugging Properties" to "Send Errors to Browser = True", the web app REFUSES to send errors to the browser and continues to send a 500 internal server error.
My browser has "Show Friendly HTTP Error Messages" unchecked.
Failed Request Tracing is installed (not sure if that's related)
Happens both on web pages loaded locally on the server and remotely
The App Pool is integrated (not sure if that matters)
Any ideas?
Try :
Internet Information Services (IIS) Manager —> Default Web Site —> Click Error Pages properties and select Detail errors
I was having the same issue with a Classic ASP app running in a subfolder of a site. I had enabled detailed errors and the 500 was still showing. My resolution was to enable parent paths in the ASP section in IIS for the site as the application was referencing the parent folder using "../":
I had this occuring on a Classic ASP application running in a subfolder of a site. The solution was:
IIS > Click into your Site > Click into your Application folder > Error Pages > Edit Feature Settings > set to: Detailed Errors
IIS Manager >> double click the ASP icon to open the ASP page. Expand the Debugging Properties node and set Send Errors To Browser to True.
Refer : http://www.chestysoft.com/asp-error-messages.asp
If your website is configured to connect to the physical path of the website as a specific user, instaed of using pass-through authentication, you may get this error if there is a permissions error with this user. It may also be necessary to restart the Windows Process Activation Service and then restart IIS.
If you are hosting the project in a shared environment then you can use the following snippet to view the errors.
<configuration>
<system.webServer>
<httpErrors errorMode="Detailed" />
</system.webServer>
<system.web>
<customErrors mode="Off" />
<compilation debug="true" />
</system.web>
Refer this URL for complete information http://blogs.iis.net/rickbarber/working-past-500-internal-server-error
Hope it helps someone
I had a 500 error with an ASP Classic application I had just installed on a new server (Windows 2019). Every URL on the application returned 500, no matter what. But no errors were being shown in the Windows event log, and despite configuring detailed errors, as mentioned in several the other answers here, no specific error was being displayed in the browser.
The only clue was in the IIS logs, which showed the HTTP status code as 500, and the IIS substatus code as 19. So a 500.19 error.
That led me to
and the specific issue I was having was answered by the second part of this section:
https://learn.microsoft.com/en-us/troubleshoot/iis/http-error-500-19-webpage#hresult-code-0x80070005
which says:
Don't configure the website to use UNC pass-through authentication to
access the remote UNC share. Instead, specify a user account that has
the appropriate permissions to access the remote UNC share.
and (this is the part I needed to do):
Grant the Read permission to the IIS_IUSRS group for the
ApplicationHost.config or Web.config file. To do it, follow these
steps:
In Windows Explorer, locate the folder that contains the
ApplicationHost.config file that is associated with the website, or
locate the virtual directories or the application directories that
contain the Web.config file that is associated with the website.
Note
The Web.config file may not be in the virtual directories or the
application directories in IIS. Even in this situation, you have to
follow these steps.
Right-click the folder that contains the ApplicationHost.config file,
or right-click the virtual or application directories that may contain
the Web.config file.
Select Properties.
Select the Security tab, and then Select Edit.
Select Add.
In the Enter the object names to select box, type
\IIS_IUSRS, select Check Names, and then select OK.
Note
is a placeholder for the computer name.
Select the Read check box, and then select OK.
In the Properties dialog box for the folder, select OK.
Note
Make sure that the folder properties are inherited by the
ApplicationHost.config and Web.config files so that IIS_IUSRS has the
Read permission for those files.

Retrieving the COM class factory for component failed

I am using an excel object (COM component) for excel manipulation. It works fine on my PC, but when I deploy the application to our Intranet I am getting this error:
Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005
I am using windows authentication and impersonate=true in my web.config.
I made all the settings in component service but it still gives the same error.
Please help
I had the same error when I deployed my app. I've got solution from this site: Component with CLSID XXX failed due to the following error: 80070005 Access is denied
Here is this solution:
In DCOMCNFG, right click on the My Computer and select properties.
Choose the COM Securities tab.
In Access Permissions, click Edit Defaults and add Network Service to it and give it Allow local access permission. Do the same for < Machine_name >\Users.
In Launch and Activation Permissions, click Edit Defaults and add Network Service to it and give it Local launch and Local Activation permission. Do the same for < Machine_name >\Users.
*I used forms authentication.
This did the trick for me:
(solution from the msdn forum)
goto Controlpanel --> Administrative tools-->Component Services -->computers --> myComputer -->DCOM Config --> Microsoft Excel Application.
right click to get properties dialog. Goto Security tab and customize permissions accordingly.
In Launch and Application Permissions, select Customize, Edit. Add the user / group that calls the application.
There's one more issue you might need to address if you are using the Windows 2008 Server with IIS7. The server might report the following error:
Microsoft Office Excel cannot access the file 'c:\temp\test.xls'. There are several possible reasons:
The file name or path does not exist.
The file is being used by another program.
The workbook you are trying to save has the same name as a currently open workbook.
The solution is posted here (look for the text posted by user Ogawa): http://social.msdn.microsoft.com/Forums/en-US/innovateonoffice/thread/b81a3c4e-62db-488b-af06-44421818ef91?prof=required
You will also get this error when there are stale EXCEL.EXE processes in the system (Use Task Manager --> Processes tab to view these.)
Kill all those instances and the application would work normally.
I have Done the Following Things in IIS 8.5 (Windows Server 2012 R2)Server and its Worked in My Case Without Restart:
Selecting The Application Pool That Connected to The Application in IIS
And Right Click --> Advanced Settings --> Process Model --> Select Local System Instead of Recommended ApplicationPoolIdentity
And Make Sure C:\Windows\SysWOW64\config\systemprofile\desktop Have Enough Access For Users.
Refresh the Website Link that Connected With this Pool
In case it helps somebody:
I am running Windows 7 64-bit and I wanted to register a 32-bit dll.
First I tried: regsvr32 <path\name.dll> and got the following error:
System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {A1D59B81-C868-4F66-B58F-AC94A4A7982E} failed due to the following error: 80040154.
Then I tried to add the application through the Component Services (Run->DCCOMCNFG) and got the following error:
System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {A1D59B81-C868-4F66-B58F-AC94A4A7982E} failed due to the following error: 80070005.
There are many links to solving it but what worked for me was:
Console Root -> Component Services -> Computers -> My Computer -> COM+ Applications -> your_application_name -> Properties: Security tab: Authorization: Uncheck 'Enforce access checks for this application'.
I don't know what it does.
I can understand your pain. In my case the error got resolved by performing below steps:
Start > Run > dcomcnfg.
Open the folder DCOM Config and Select Component Services > Computers > My Computer > DCOM Config.
Select “Microsoft Office Word 97 – 2003 document”/”Microsoft Excel Application” and go to its properties.
In "Security" tab set “Launch and Activation Permissions” need to be Customize (Authorized user).
Now go to IIS and select application pool of the Web and go to its Advanced Settings and select “NETWORK SERVICE” as identity user.
Hope this helps.
The CLSID you describe is for the Microsoft.Office.Interop.Excel.ApplicationClass. This class basically launches excel.exe through InprocServer32. If you don't have it installed then it will return the error message you received above.
For IIS 8 I did basically the same thing as Monic. Im running my application as its own app pool on an x64 machine 1.In DCOMCNFG, right click on the My Computer and select properties.
2.Choose the COM Securities tab.
3.In Access Permissions, click Edit Defaults and add iis apppool\myapp to it and give it Allow local access permission. Do the same for iis apppool\myapp
4.In launch and Activation Permissions, click Edit Defaults and add iis apppool\myapp to it and give it Local launch and Local Activation permission. Do the same for iis apppool\myapp.
additionally I had to make the folders outlined under C:\Windows\SysWOW64\config\systemprofile\Desktop and give read \ write permissions to iis apppool\myapp also
I'm getting this same error when trying to export a csv file from Act! to Excel. One workaround I found was to run Act! as an administrator.
That tells me this is probably some sort of permission issue but none of the previous answers here solved the problem. I tried running DCOMCNFG and changing the permissions on the whole computer, and I also tried to just change permissions on the Excel component but it's not listed in DCOMCNFG on my Windows 10 Pro PC.
Maybe this workaround will help someone until a better solution is found.
If you run the app from the Task Scheduler, it helps to check option in General parameters "Run with highest privileges".

Resources