ERROR : HTTP Error 500.2* – Internal Server Error

ERROR:

HTTP Error 500.2* – Internal Server Error
An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.

CAUSE:

IIS7 and above default to using “integrated pipeline mode”; whereas, IIS6 and below utilize what is now deemed “classic mode.”  In classic mode, IIS uses ISAPI extensions; whereas, integrated mode handles all requests through a pipeline of IIS and is integrated with SP.NET through this same pipeline.  Integrated mode is much more efficient with ASP.NET.  Read more about how to enhance your application with integrated pipelines here.

RESOLUTIONS:

There are multiple resolutions to this problem; however, depending on your application, the quickest way to resolve this problem can be to:

1.     Open IIS

2.     Navigate to the app pool for your application

3.     Switch from “integrated mode” to “classic mode.”

Other possible options:

1.       If your application is running legacy code, then update your code.

2.       If you are running in 64-bit Windows then navigate to “Advanced Settings” and set “Enable 32-Bit Applications” = True.

3.       Try keeping your default website in the default app pool, ie Integrated Pipeline mode, but keep your virtual directory in classic mode.

4.       This last option is debatable and may only be considered as a temporary fix.  In your web.config, insert the following:

<configuration>

  <system.webServer>

    <validation validateIntegratedModeConfiguration="false" />

  </system.webServer>

</configuration>

 

 

Web Development: Introduction To Localhost and IIS

What is your “localhost”?

In computer networking, localhost (meaning this computer) is the standard hostname given to the address of the loopback network interface. This mechanism is useful for developers to test their software.

The default address for localhost is 127.0.0.1.  This special IP address, also called the Loopback Address,  is always defined to mean “the current machine”. It is not the same thing as the external IP address of your web server:

Localhost is configurable in the Hosts file (typically located at C:WindowsSystem32DriversEtcHosts). Due to multiple dependencies, it is usually not recommended to reconfigure it.

Instead, you can set up alternate domains in your Hosts file. For example, you could set

192.168.1.250   my.internal.website.com
192.168.1.249   your.internal.website.net

How Does “localhost” Relate To IIS ?

Internet Information Services (IIS) – is a web server software application created by Microsoft for use with Microsoft Windows.

If IIS is expecting a connection to IP address 192.168.1.250, then a connection to 127.0.0.1 will not match.  When IIS responds to an HTTP request, it uses 3 pieces of information to figure out what web site it should use to build the response:

  1. IP address – The browser uses the name in the address bar to perform a DNS query and get the actual IP address of the host. It sends the http request to that IP address.
  2. Port – By default this is 80 for non SSL requests and 443 for SSL.
  3. Host header – Part of an http request is a host header. This host header matches the domain name of the address requested by the user, including sub-domain or host names.
When running a browser on your machine you type: http://localhost (no port number), what does IIS do?  Per previous replies the browser converts localhost to 127.0.0.1 as the IP address and constructs an HTTP request for that IP address. The host header will be localhost.  In this scenario IIS will see that both Website1 and Website2 do not have matching ip addresses and so the default site will be used to process the request.
If you wish to have Website1 or Website2  respond to the request, disable the default site and change the IP address setting to for either Website1 or Website2. 

Deprecated ‘center’ Tag In HTML 5

Ok, so if your web site is no longer centered in FireFox but still works in Internet Explorer, then remember back to when the ‘center’ tag was deprecated back in HTML 5. FireFox simply will not tolerate this tag any longer and pushes to the standard of having tags DESCRIBE its contents and not DEFINE them.

Anyway, you might get away with replacing your ‘center’ tags with:

‘div style=”text-align: center;”‘

However, it would probably be better to change your architecture to reference an “auto” property in your .css :

“margin: auto;”

“margin-left: auto;”

“margin-right: auto;”

Error: Ambiguous Server Tag

Sometimes I run into this error when using ASP.NET:

“The server tag ‘asp:ScriptManager’ is ambiguous. Please modify the associated registration that is causing ambiguity and pick a new tag prefix.”

Usually, this occurs because I am having a conflict between different versions of System.Web.Extensions.

For example, in my web.config I have the reference to the 3.5 version:

<add tagPrefix=asp namespace=System.Web.UI assembly=System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35/>

But in my .aspx page I have a reference to the 1.0 version:

<%@ Register Assembly=”System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ Namespace=”System.Web.UI” TagPrefix=”asp” %>

Solution: Remove “Register Assembly” from .aspx and the asp tagPrefix should now use the web.config version and correctly reference, in this case, AJAX 3.5.