Iis web config error

This is driving the whole team crazy. There must be some simple mis-configured part of IIS or our Web Server, but every time we try to run out ASP.NET Web Application on IIS 7.5 we get the following

This is driving the whole team crazy. There must be some simple mis-configured part of IIS or our Web Server, but every time we try to run out ASP.NET Web Application on IIS 7.5 we get the following error…

Here’s the error in full:

HTTP Error 500.19 - Internal Server Error

The requested page cannot be accessed because the related configuration  
data for the page is invalid.

`Detailed Error Information` 
Module              IIS Web Core
Notification        Unknown
Handler             Not yet determined
Error Code          0x8007000d
Config Error
Config File         \?E:wwwrootweb.config
Requested URL       http://localhost:80/Default.aspx
Physical Path 
Logon Method        Not yet determined
Logon User          Not yet determined
Config Source
   -1: 
    0: 

The machine is running Windows Server 2008 R2. We’re developing our Web Application using Visual Studio 2008.

According to Microsoft the code 8007000d means there’s a syntax error in our web.config — except the project builds and runs fine locally. Looking at the web.config in XML Notepad doesn’t bring up any syntax errors, either. I’m assuming it must be some sort of poor configuration on my part…?

Does anyone know where I might find further information about the error? Nothing is showing in EventViewer, either :(

Not sure what else would be helpful to mention…

Assistance is greatly appreciated. Thanks!

UPDATES! — POSTED WEB.CONFIG BELOW

Ok, since I posted the original question above, I’ve tracked down the precise lines in the web.config that were causing the error.

Here are the lines (they appear between <System.webServer> tags)…

    <httpHandlers>
        <remove verb="*" path="*.asmx"/>
        <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
    </httpHandlers>

Note: If I delete the lines between the <httpHandlers> I STILL get the error. I literally have to delete <httpHandlers> (and the lines inbetween) to stop getting the above error.

Once I’ve done this I get a new 500.19 error, however. Thankfully, this time IIS actually tells me which bit of the web.config is causing a problem…

    <handlers>
        <remove name="WebServiceHandlerFactory-Integrated"/>
        <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory,System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
        <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
        <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
    </handlers>

Looking at these lines it’s clear the problem has migrated further within the same <system.webServer> tag to the <handlers> tag.

The new error is also more explicit and specifically complains that it doesn’t recognize the attribute «validate» (as seen on the third line above). Removing this attribute then makes it complain that the same line doesn’t have the required «name» attribute. Adding this attribute then brings up ASP.NET error…

Could not load file or assembly
‘System.web.Extensions,
Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=f2cb5667dc123a56’ or
one of its dependencies. The system
cannot find the file specified.

Obviously I think these new errors have just arisen from me deleting the <httpHandlers> tags in the first place — they’re obviously needed by the application — so the question remains: Why would these tags kick up an error in IIS in the first place???

Do I need to install something to IIS to make it work with them?

Thanks again for any help.

WEB.CONFIG

Here’s the troublesome bits of our web.Config

<system.Web>

<!-- stuff cut out -->

    <httpHandlers>
        <remove verb="*" path="*.asmx"/>
        <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
        <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
        <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56" validate="false"/>
    </httpHandlers>
    <httpModules>
        <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
    </httpModules>
</system.web>

<system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <modules>
        <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
    </modules>
    <remove verb="*" path="*.asmx"/>
    <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
    <handlers>
        <remove name="WebServiceHandlerFactory-Integrated"/>
        <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory,System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
        <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
        <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=f2cb5667dc123a56"/>
    </handlers>
</system.webServer>

Содержание

  1. Ошибка HTTP 500.19 — внутренняя ошибка сервера при открытии веб-страницы IIS
  2. Код HRESULT 0x8007000d
  3. Код HRESULT 0x80070021
  4. Код HRESULT 0x80070005
  5. Код HRESULT 0x800700b7
  6. Код HRESULT 0x8007007e
  7. Код HRESULT 0x800700c1
  8. Код HRESULT 0x8007010b
  9. Код HRESULT 0x8007052e
  10. Код HRESULT 0x80070003
  11. Устраните проблему с поврежденным файлом конфигурации IIS при обновлении Windows
  12. HTTP Error 500.19 — internal server error when you open an IIS Webpage
  13. HRESULT code 0x8007000d
  14. HRESULT code 0x80070021
  15. HRESULT code 0x80070005
  16. HRESULT code 0x800700b7
  17. HRESULT code 0x8007007e
  18. HRESULT code 0x800700c1
  19. HRESULT code 0x8007010b
  20. HRESULT code 0x8007052e
  21. HRESULT code 0x80070003
  22. Fix break IIS configuration file issue when you update windows

Ошибка HTTP 500.19 — внутренняя ошибка сервера при открытии веб-страницы IIS

В этой статье описывается решение проблемы, при которой отображается сообщение об ошибке HTTP 500.19 в веб-приложении в IIS 7.0 и более поздних версиях.

Оригинальная версия продукта: службы IIS 7.0 и более поздних версий
Оригинальный номер КБ: 942055

Чтобы устранить эту ошибку, ознакомьтесь со следующими разделами для получения соответствующих сведений о коде ошибки.

Код HRESULT 0x8007000d

Сообщение об ошибке:

Ошибка сервера в приложении «имя приложения»
Ошибка HTTP 500.19 — внутренняя ошибка сервера
HRESULT: 0x8007000d
Описание HRESULT:
Запрашиваемая страница недоступна из-за неверной конфигурации данных для этой страницы.

Эта проблема возникает из-за того, что файл ApplicationHost.config или Web.config содержит поврежденный или неопознанный XML-элемент. IIS не может определить XML-элементы модулей, которые не были установлены. Например, модуль переопределения URL-адресов для IIS.

Используйте один из следующих способов:

  • Удалите поврежденный XML-элемент из файла ApplicationHost.config или Web.config.
  • Проверьте неопознанные XML-элементы и установите соответствующие модули IIS.

Код HRESULT 0x80070021

Сообщение об ошибке:

Ошибка сервера в приложении «имя приложения»
Ошибка HTTP 500.19 — внутренняя ошибка сервера
HRESULT: 0x80070021
Описание HRESULT:
Запрашиваемая страница недоступна из-за неверной конфигурации данных для этой страницы.

Эта проблема может возникать, когда указанная часть файла конфигурации IIS блокируется на более высоком уровне конфигурации.

Разблокируйте указанный раздел или не используйте его на более высоком уровне. Дополнительные сведения о блокировке конфигурации см. в разделе Использование блокировки в конфигурации IIS 7.0.

Код HRESULT 0x80070005

Сообщение об ошибке:

Ошибка сервера в приложении «имя приложения»
Ошибка HTTP 500.19 — внутренняя ошибка сервера
HRESULT: 0x80070005
Описание HRESULT:
Запрашиваемая страница недоступна из-за неверной конфигурации данных для этой страницы.

Эта проблема может возникать по одной из следующих причин:

  • IIS используется на компьютере под управлением Windows. Кроме того, настройте веб-сайт для использования сквозной проверки подлинности UNC для доступа к удаленному серверу общего доступа UNC.
  • У группы IIS_IUSRS нет необходимых разрешений для файла ApplicationHost.config, Web.config или виртуальных каталогов/каталогов приложений IIS.

Используйте один из следующих способов:

Не задавайте в настройках веб-сайта использование сквозной проверки подлинности UNC для доступа к удаленному серверу общего доступа UNC. Вместо этого укажите учетную запись пользователя с надлежащими разрешениями для доступа к удаленному ресурсу UNC.

Предоставьте группе IIS_IUSRS разрешение на чтение файла ApplicationHost.config или Web.config. Для этого выполните следующие действия:

В проводнике Windows найдите папку, содержащую файл ApplicationHost.config, связанный с веб-сайтом, либо виртуальные каталоги или каталоги приложений, содержащие связанный с веб-сайтом файл Web.config.

Файл Web.config может не находиться в виртуальных каталогах или каталогах приложений в IIS. Даже в такой ситуации необходимо выполнить следующие действия.

Щелкните правой кнопкой мыши папку, содержащую файл ApplicationHost.config, либо виртуальные каталоги или каталоги приложений, которые могут содержать файл Web.config.

Выберите пункт Свойства.

Перейдите на вкладку Безопасность и нажмите Редактировать.

Нажмите Добавить.

В поле «Введите имена объектов IIS_IUSRS, выберите «Проверить имена» и нажмите кнопку «ОК«.

— это заполнитель для имени компьютера.

Установите флажок Чтение и нажмите кнопку ОК.

В диалоговом окне Свойства для папки нажмите кнопку OK.

Удостоверьтесь, что свойства папки наследуются файлами ApplicationHost.config и Web.config, чтобы у IIS_IUSRS было разрешение на чтение таких файлов.

Код HRESULT 0x800700b7

Сообщение об ошибке:

Ошибка сервера в приложении «имя приложения»
Ошибка HTTP 500.19 — внутренняя ошибка сервера
HRESULT: 0x800700b7
Описание HResult
Запрашиваемая страница недоступна из-за неверной конфигурации данных для этой страницы.

Эта проблема может возникать при наличии повторяющейся записи для указанного раздела конфигурации, заданного на более высоком уровне в иерархии конфигурации (например, файл ApplicationHost.config или Web.config на родительском веб-сайте или в папке). В сообщении об ошибке указано расположение повторяющихся записей.

Изучите указанный файл конфигурации и сравните его с родительским файлом ApplicationHost.config или Web.config, чтобы проверить наличие повторяющихся записей, предполагаемых в сообщении об ошибке. Удалите дублирующую запись или сделайте ее уникальной. Например, эта проблема может возникать из-за того, что в файле ApplicationHost.config содержится повторяющаяся запись для следующего кода:

Чтобы решить эту проблему, удалите в файле ApplicationHost.config повторяющуюся запись для правила авторизации. Для этого выполните следующие действия:

Нажмите кнопку Пуск, введите Блокнот в поле Начать поиск, затем щелкните правой кнопкой мыши Блокнот и выберите Запуск от имени администратора.

Если система запросит пароль администратора или подтверждение, введите пароль или нажмите кнопку Продолжить.

В меню Файл нажмите Открыть, введите %windir%System32inetsrvconfigapplicationHost.config в поле Имя файла и нажмите кнопку Открыть.

В файле ApplicationHost.config удалите дублирующую запись, похожую на следующий код:

Код HRESULT 0x8007007e

Сообщение об ошибке:

Ошибка сервера в приложении «имя приложения»
Ошибка HTTP 500.19 — внутренняя ошибка сервера
HRESULT: 0x8007007e
Описание HResult
Запрашиваемая страница недоступна из-за неверной конфигурации данных для этой страницы.

Эта проблема возникает в том случае, если файл ApplicationHost.config или Web.config ссылается на модуль или библиотеку DLL, которые являются недопустимыми или не существуют.

В файле ApplicationHost.config или Web.config найдите недопустимую ссылку на модуль или библиотеку DLL и исправьте ее. Чтобы определить, какая ссылка на модуль неверная, включите функцию «Трассировка невыполненных запросов» и воспроизведите проблему.

Код HRESULT 0x800700c1

Сообщение об ошибке:

Ошибка сервера в приложении «имя приложения»
Ошибка HTTP 500.19 — внутренняя ошибка сервера
HRESULT: 0x800700c1
Описание HRESULT:
Запрашиваемая страница недоступна из-за неверной конфигурации данных для этой страницы.

Эта проблема может возникать, если разрядность указанного модуля отличается от разрядности пула приложений, где он размещен. Например, если вы пытаетесь загрузить 32-разрядный компонент в 64-разрядный пул приложений. Подобная проблема может также наблюдаться при повреждении указанного модуля.

Убедитесь, что разрядность указанного модуля такая же, как и у пула размещенных приложений. Кроме того, убедитесь, что модуль не поврежден.

Код HRESULT 0x8007010b

Сообщение об ошибке:

Ошибка сервера в приложении «имя приложения»
Ошибка HTTP 500.19 — внутренняя ошибка сервера
HRESULT: 0x8007010b
Описание HRESULT:
Запрашиваемая страница недоступна из-за неверной конфигурации данных для этой страницы.

Эта проблема может возникать, если указанный каталог содержимого недоступен.

  • Убедитесь, что путь к файлу существует.
  • Убедитесь, что путь к файлу указан правильно.
  • Убедитесь, что путь к файлу имеет правильный набор разрешений на уровне файлов.
  • Убедитесь, что путь к файлу указывает на допустимый тип файловой системы.

Если вам точно не известен путь к файлу, определите его с помощью монитора процессов или трассировки невыполненных запросов.

Код HRESULT 0x8007052e

Сообщение об ошибке:

Ошибка сервера в приложении «имя приложения»
Ошибка HTTP 500.19 — внутренняя ошибка сервера
HRESULT: 0x8007052e
Описание HRESULT:
Запрашиваемая страница недоступна из-за неверной конфигурации данных для этой страницы.

У удостоверения процесса по умолчанию в IIS недостаточно разрешений для открытия файла Web.config на удаленном общем ресурсе.

Убедитесь, что учетная запись удостоверения пула приложений этого веб-приложения имеет достаточно разрешений для открытия файла Web.config.

Код HRESULT 0x80070003

Сообщение об ошибке:

Ошибка сервера в приложении «имя приложения»
Ошибка HTTP 500.19 — внутренняя ошибка сервера
HRESULT: 0x80070003
Описание HRESULT:
Не удается прочитать файл конфигурации.

Эта ошибка вызвана отсутствием разрешения или физическим путем, который не соответствует пути для виртуального каталога. Например, в физическом корневом пути веб-приложения нет Web.config.

  • Убедитесь, что путь Web.config существует и имеет правильный набор разрешений.
  • Выполните сбор журналов монитора процессов, чтобы получить дополнительные сведения об ошибке.

Устраните проблему с поврежденным файлом конфигурации IIS при обновлении Windows

В соответствии с общим правилом безопасности для всех файлов конфигурации (не ограниченные IIS) должны быть созданы резервные копии перед установкой какого-либо обновления. Если вы используете виртуальные машины, сделайте снимок виртуальной машины перед ее обновлением. Этот совет применим не только к обновлениям Windows.

Источник

HTTP Error 500.19 — internal server error when you open an IIS Webpage

This article resolves a problem in which you receive an «HTTP 500.19» error message on a web application in Internet Information Services (IIS) 7.0 and later versions.

Original product version: В Internet Information Services 7.0 and later versions
Original KB number: В 942055

To resolve this error, check the following sections for the appropriate error code information.

HRESULT code 0x8007000d

Server Error in Application «application name»
HTTP Error 500.19 – Internal Server Error
HRESULT: 0x8007000d
Description of HRESULT
The requested page cannot be accessed because the related configuration data for the page is invalid.

This problem occurs because the ApplicationHost.config or Web.config file contains a malformed or unidentified XML element. IIS can’t identify the XML elements of the modules that are not installed. For example, IIS URL Rewrite module.

Use one of the following methods:

  • Delete the malformed XML element from the ApplicationHost.config or Web.config file.
  • Check the unidentified XML elements, and then install the relevant IIS modules.

HRESULT code 0x80070021

Server Error in Application «application name»
HTTP Error 500.19 – Internal Server Error
HRESULT: 0x80070021
Description of HRESULT
The requested page cannot be accessed because the related configuration data for the page is invalid.

This problem can occur if the specified portion of the IIS configuration file is locked at a higher configuration level.

Unlock the specified section, or don’t use it at the higher level. For more information about configuration locking, see How to Use Locking in IIS 7.0 Configuration.

HRESULT code 0x80070005

Server Error in Application «application name»
HTTP Error 500.19 – Internal Server Error
HRESULT: 0x80070005
Description of HRESULT
The requested page cannot be accessed because the related configuration data for the page is invalid.

This problem occurs for one of the following reasons:

  • You’re using IIS on a computer that is running Windows. Additionally, you configure the website to use Universal Naming Convention (UNC) pass-through authentication to access a remote UNC share.
  • The IIS_IUSRS group doesn’t have the appropriate permissions for the ApplicationHost.config file, the Web.config file, or the virtual or application directories of IIS.

Use one of the following methods:

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.

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.

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.

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.

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.

HRESULT code 0x800700b7

Server Error in Application «application name»
HTTP Error 500.19 – Internal Server Error
HRESULT: 0x800700b7
Description of HResult
The requested page cannot be accessed because the related configuration data for the page is invalid.

This problem may occur if there’s a duplicate entry for the specified configuration section setting at a higher level in the configuration hierarchy (for example, ApplicationHost.config or Web.config file in a parent site or folder). The error message itself points out the location of the duplicate entries.

Examine the specified configuration file, and compare it with its parent ApplicationHost.config or Web.config file to check for duplicate entries, as suggested by the error message. Either remove the duplicate entry, or make the entry unique. For example, this problem may occur because the ApplicationHost.config file has a duplicate entry for the following code:

To resolve this problem, delete the duplicate entry in the ApplicationHost.config file for the authorization rule. To do it, follow these steps:

Select Start, type Notepad in the Start Search box, right-click Notepad, and then select Run as administrator.

If you’re prompted for an administrator password or for a confirmation, type the password, or select Continue.

On the File menu, select Open, type %windir%System32inetsrvconfigapplicationHost.config in the File name box, and then select Open.

In the ApplicationHost.config file, delete the duplicate entry that resembles the following code:

HRESULT code 0x8007007e

Server Error in Application «application name»
HTTP Error 500.19 – Internal Server Error
HRESULT: 0x8007007e
Description of HResult
The requested page cannot be accessed because the related configuration data for the page is invalid.

This problem occurs because the ApplicationHost.config or Web.config file references a module or a DLL that is invalid or doesn’t exist.

In the ApplicationHost.config or Web.config file, locate the module reference or the DLL reference that is invalid, and then fix the reference. To determine which module reference is incorrect, enable Failed Request Tracing, and then reproduce the problem.

HRESULT code 0x800700c1

Server Error in Application «application name»
HTTP Error 500.19 – Internal Server Error
HRESULT: 0x800700c1
Description of HRESULT
The requested page cannot be accessed because the related configuration data for the page is invalid.

This problem can occur if the bitness of the specified module is different than that of the application pool hosting the application. For example, you’re trying to load a 32-bit component into a 64-bit application pool. This problem may also occur if the specified module is corrupted.

Make sure that the specified module’s bitness is the same as that of the hosting application pool. Also, make sure that the module is not corrupted.

HRESULT code 0x8007010b

Server Error in Application «application name»
HTTP Error 500.19 – Internal Server Error
HRESULT: 0x8007010b
Description of HRESULT
The requested page cannot be accessed because the related configuration data for the page is invalid.

This problem can occur if the specified content directory cannot be accessed.

  • Verify that the file path exists.
  • Verify that the file path is correctly named.
  • Verify that the file path has the correct file-level permissions set.
  • Verify that the file path is pointing to a valid file system type.

If you aren’t sure what the file path is, use the Process Monitor or Failed Request Tracing tool to identify it.

HRESULT code 0x8007052e

Server Error in Application «application name»
HTTP Error 500.19 – Internal Server Error
HRESULT: 0x8007052e
Description of HRESULT
The requested page cannot be accessed because the related configuration data for the page is invalid.

The default process identity in IIS doesn’t have sufficient permissions to open the Web.config file on a remote share.

Verify that the application pool identity account of this web application has sufficient permissions to open the Web.config file.

HRESULT code 0x80070003

Server Error in Application «application name»
HTTP Error 500.19 – Internal Server Error
HRESULT: 0x80070003
Description of HRESULT
Cannot read configuration file.

This error is caused by a lack of permission or by a physical path that doesn’t match the path for the virtual directory. For example, no Web.config exists under the web app physical root path.

  • Verify that the Web.config path exists and has correct permissions set.
  • Collect Process Monitor logs to get more information about the error.

Fix break IIS configuration file issue when you update windows

As a general safety rule, all configuration files (not limited to IIS) should be backup before installing any update. If you use Virtual Machines, take a snapshot of the Virtual Machine before you update it. This advice isn’t limited to Windows updates.

Источник

User1310055179 posted

Hi,

I am trying to install an asp.net 4.5 web form app on IIS 8.5, on windows server 2012 r2 and I get the following error message:

<div id=»content»> <div class=»content-container»>

HTTP Error 500.19 — Internal Server Error

The requested page cannot be accessed because the related configuration data for the page is invalid.

<div id=»content»> <div class=»content-container»>

<fieldset>

Detailed Error Information:

<div id=»details-left»>

Module    IIS Web Core
Notification    BeginRequest
Handler    Not yet determined
Error Code    0x8007007b
Config Error    Cannot read configuration file

</div></fieldset>

</div> </div> </div> </div>

The application works just fine after installing it on my local IIS.

I am trying to test it using the defaultapppool which is set to v4.0 version. The defaultapppool works great with different applications. I gave the app folder modify permissions for the IIS_IUSRS and USERS. 

These are my configuration files located on the root folder:

Web.Config:

<?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <!--<configSections>
    --><!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --><!--
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <connectionStrings/>-->
  
  <system.web>
    <!--remove ASP.NET version from the header- for security- 280818-->
    <httpRuntime enableVersionHeader="false"/>
    
    <compilation debug="true" targetFramework="4.5" />
    
    <pages>
      <namespaces>
        <add namespace="System.Web.Optimization" />
      </namespaces>
      <controls>
        <add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt" />
      </controls>
    </pages>
 
    <authentication mode="Forms">
      <forms loginUrl="login.aspx" slidingExpiration="true" name="MyCustomAuthentication" timeout="60"/>
    </authentication>
    <!--authentication timeout needs to be double the size of the session timeout (if slidingExpiration is set to TRUE)-->
    
    <authorization>
      <deny users="?"/>
    </authorization>
    <sessionState mode="InProc" timeout="30"/>
    <customErrors mode="On" defaultRedirect="ErrorPage.aspx?handler=customErrors%20section%20-%20Web.config">
      <error statusCode="404" redirect="ErrorPage.aspx?msg=404&amp;handler=customErrors%20section%20-%20Web.config"/>
    </customErrors>
    <globalization requestEncoding="windows-1255" responseEncoding="windows-1255" fileEncoding="windows-1255" culture="he-IL" uiCulture="he-IL"/>
    
    <profile defaultProvider="DefaultProfileProvider">
      <providers>
        <add name="DefaultProfileProvider" type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" />
      </providers>
    </profile>
    
    <!--
            If you are deploying to a cloud environment that has multiple web server instances,
            you should change session state mode from "InProc" to "Custom". In addition,
            change the connection string named "DefaultConnection" to connect to an instance
            of SQL Server (including SQL Azure and SQL  Compact) instead of to SQL Server Express.
      -->
    
  </system.web>
 
  <system.webServer>
    
    <!--remove X-Powered-By from the header- for security- 280818-->
    <httpProtocol>
      <customHeaders>
        <remove name="X-Powered-By"/>
      </customHeaders>
    </httpProtocol>
    <validation validateIntegratedModeConfiguration="false"/>
    
  </system.webServer>
 
  <!--allow all users to see the Images folder (for login page)-->
  <location path="Images">
    <system.web>
      <authorization>
        <allow users="*"/>
      </authorization>
    </system.web>
  </location>
  <!--allow all users to see the login page-->
  <location path="login.aspx">
    <system.web>
      <authorization>
        <allow users="*"/>
      </authorization>
    </system.web>
  </location>
  
  
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="DotNetOpenAuth.Core" publicKeyToken="2780ccd10d57b246" />
        <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="DotNetOpenAuth.AspNet" publicKeyToken="2780ccd10d57b246" />
        <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <!--<entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
  </entityFramework>-->
</configuration>

packages.config:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="AspNet.ScriptManager.jQuery" version="1.8.2" targetFramework="net45" />
  <package id="AspNet.ScriptManager.jQuery.UI.Combined" version="1.8.24" targetFramework="net45" />
  <package id="DotNetOpenAuth.AspNet" version="4.1.4.12333" targetFramework="net45" />
  <package id="DotNetOpenAuth.Core" version="4.1.4.12333" targetFramework="net45" />
  <package id="DotNetOpenAuth.OAuth.Consumer" version="4.1.4.12333" targetFramework="net45" />
  <package id="DotNetOpenAuth.OAuth.Core" version="4.1.4.12333" targetFramework="net45" />
  <package id="DotNetOpenAuth.OpenId.Core" version="4.1.4.12333" targetFramework="net45" />
  <package id="DotNetOpenAuth.OpenId.RelyingParty" version="4.1.4.12333" targetFramework="net45" />
  <package id="EntityFramework" version="5.0.0" targetFramework="net45" />
  <package id="jQuery" version="1.8.2" targetFramework="net45" />
  <package id="jQuery.UI.Combined" version="1.8.24" targetFramework="net45" />
  <package id="Microsoft.AspNet.FriendlyUrls" version="1.0.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.FriendlyUrls.Core" version="1.0.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.Membership.OpenAuth" version="1.0.1" targetFramework="net45" />
  <package id="Microsoft.AspNet.Providers.Core" version="1.2" targetFramework="net45" />
  <package id="Microsoft.AspNet.Providers.LocalDB" version="1.1" targetFramework="net45" />
  <package id="Microsoft.AspNet.ScriptManager.MSAjax" version="4.5.6" targetFramework="net45" />
  <package id="Microsoft.AspNet.ScriptManager.WebForms" version="4.5.6" targetFramework="net45" />
  <package id="Microsoft.AspNet.Web.Optimization" version="1.0.0" targetFramework="net45" />
  <package id="Microsoft.AspNet.Web.Optimization.WebForms" version="1.0.0" targetFramework="net45" />
  <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
  <package id="Modernizr" version="2.6.2" targetFramework="net45" />
  <package id="WebGrease" version="1.1.0" targetFramework="net45" />
</packages>

Bundle.config:

<?xml version="1.0" encoding="utf-8" ?>
<bundles version="1.0">
  <styleBundle path="~/Content/css">
    <include path="~/Content/Site.css" />
  </styleBundle>
  <styleBundle path="~/Content/themes/base/css">
    <include path="~/Content/themes/base/jquery.ui.core.css" />
    <include path="~/Content/themes/base/jquery.ui.resizable.css" />
    <include path="~/Content/themes/base/jquery.ui.selectable.css" />
    <include path="~/Content/themes/base/jquery.ui.accordion.css" />
    <include path="~/Content/themes/base/jquery.ui.autocomplete.css" />
    <include path="~/Content/themes/base/jquery.ui.button.css" />
    <include path="~/Content/themes/base/jquery.ui.dialog.css" />
    <include path="~/Content/themes/base/jquery.ui.slider.css" />
    <include path="~/Content/themes/base/jquery.ui.tabs.css" />
    <include path="~/Content/themes/base/jquery.ui.datepicker.css" />
    <include path="~/Content/themes/base/jquery.ui.progressbar.css" />
    <include path="~/Content/themes/base/jquery.ui.theme.css" />
  </styleBundle>
</bundles>

I would really appreciate your help.

Thanks

In general, a 500.19 error happens due to invalid configuration data. The IIS configuration system will almost always point to the source of the problem. At the same time, sometimes it is important to examine the “Error Code” field which symbolizes the cause of problem.

Here’s an example of how a 500.19 error appears on an IIS 7.0 server:

500

Let’s talk about some of the causes for 500.19 errors. We will use the ERR.exe tool for looking up the associated error codes (MSDN says it’s for Exchange error codes but it works for Win32 error codes and many more.) To use ERR.exe tool and find what an HRESULT error code corresponds to, navigate to the folder where err.exe resides and run command: ERR ErrorCode

Note: Make sure to backup your applicationHost.config file before editing it manually, to avoid any further issuesJ. You can find the detailed instructions here

***************************************

Scenario 1

Error Message:

HTTP Error 500.19 — Internal Server Error

Description: The requested page cannot be accessed because the related configuration data for the page is invalid.

Module: StaticCompressionModule

Notification: MapRequestHandler

Handler: StaticFile

Error Code: 0x800700c1

Requested URL: http://localhost/

Physical Path: C:inetpubwwwroot

Logon Method: Anonymous

Logon User: Anonymous

Reason:

The Error Code in the above error message is “0x800700c1” which when translated through ERR.EXE, is

# %1 is not a valid Win32 application.

Solution:

This error normally indicates an attempt to use EITHER

Ø 32-bit executable from a 64-bit process

OR

Ø A corrupt executable

Hence the solution is to make sure that the listed module’s bitness (32bit/64bit) matches the bitness of the application Pool.

***************************************

Scenario 2

Error Message:

HTTP Error 500.19 — Internal Server Error

Description: The requested page cannot be accessed because the related configuration data for the page is invalid in the metabase on the Web server.

Error Code: 0x800700b7

Notification: BeginRequest

Module: IIS Web Core

Requested URL: http://localhost/

Physical Path: C:inetpubwwwroot

Logon User: Anonymous
Logon Method: Anonymous

Handler: StaticFile

Config Error: Cannot add duplicate collection entry of type ‘add’ with unique key attribute ‘name’ set to ‘header’

Config File: \?C:inetpubwwwrootweb.config

Config Source:

21: <customHeaders>

22: <add name=»header» value=»text/plain» />

23: </customHeaders>

Reason:

This problem essentially happens if there is a duplicate entry for the configuration section setting at a higher level in the configuration (i.e. in parent site/folder’s web.config or applicationHost.config file). The error message itself points out the location of duplicate entries.

Solution:

One should look in the site’s config file and compare it with applicationHost or web.config file at a higher level to check for duplicate entries as pointed by the error message.  You can either remove this entry to make the server run again, or make the entry non-duplicate by changing the collection key.

For example, the above error message was because of the same custom header defined at the IIS root level (applicationHost.config) and at the Default Website (web.config). To solve this, we can

1. Remove this entry from web.config file : <add name=»header» value=»text/plain» />

OR

2. Add remove OR clear element before this add element:

<remove name=»header»/>

OR

<clear />

***************************************

Scenario 3

Error Message:

HTTP Error 500.19 — Internal Server Error

The requested page cannot be accessed because the related configuration data for the page is invalid.

Module: IIS Web Core

Notification: BeginRequest

Handler: Not yet determined

Error Code: 0x8007000d

Config Error: Configuration file is not well-formed XML

Config File: \? C:inetpubwwwroot web.config

Requested URL: http://localhost/

Physical Path: C:inetpubwwwroot

Logon User: Not yet determined
Logon Method: Not yet determined

Config Source

3: <system.webServer>

4: </handlers>

5: <remove name=»StaticFile»/>

Reason:

That error message goes on to say what exactly is bad about your configuration file, hence you should refer the “Config Error” and “Config Source” sections. This problem occurs because the ApplicationHost.config file or the Web.config file contains a malformed or unsupported XML element.

Solution:

Delete the malformed XML element from the ApplicationHost.config file or from the Web.config file as indicated by the error message.

There are couples of instances that we have come across where the error code remains 0x8007000d, but the cause of issue was interesting.

In one scenario, we had a virtual directory pointing to a UNC share content. This same above 500.19 error was caused because of wrong password specified in the “Connect as..” setting. So make sure to provide the right credentials under “Connect as..” .

Another instance where the error code remained “0x8007000d” but the “Config Error” didn’t complain the mal formed XML, rather was about Configuration section encryption.

HTTP Error 500.19 – Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.

Module : ConfigurationValidationModule

Notification: BeginRequest

Handler : PageHandlerFactory-Integrated

Error Code: 0x8007000d

Config Error: Configuration section encryption is not supported

Config File: \?C:inetpubwwwrootaspnetweb.config

Requested URL: http://localhost/

Physical Path: C:inetpubwwwroot

Logon User: Not yet determined
Logon Method: Not yet determined

<identity configProtectionProvider=»RsaProtectedConfigurationProvider»>

<EncryptedData Type=http://www.w3.org/2001/04/xmlenc#Element

As the error suggests, the error is because IIS7 configuration system only supports per-attribute encryption; it does not support per-section encryption. For more details, refer Section level encryption of ASP.NET settings in IIS 7

***************************************

Scenario 4

Error Message:

HTTP 500.19 — Internal Server Error

Module: IIS Web Core

Notification: BeginRequest

Handler: Not yet determined

Error Code: 0x8007010b

Config Error: Cannot read configuration file

Config File \?C:inetpubwwwrootaspnetweb.config

Logon Method: Not yet determined

Reason:

ERROR CODE: 0x8007010b translates to “ERROR_DIRECTORY — The directory name is invalid.”

Solution:

As the error indicates, IIS is not able to find the content directory. For this error, we can run Process Monitor OR use Failed Request Tracing to get the Directory name where it fails. And then verify if that directory name/path is valid or not. If it does exist, then verify the NTFS permissions on that directory for account that is being used to access it.

We have seen this error when the site content is pointing to some Non-NTFS File system. In such cases, it is advisable to test it by placing the content on a Windows/NTFS share.

***************************************

Scenario 5

Error Message:

HTTP Error 500.19 — Internal Server Error
Description: The requested page cannot be accessed because the related configuration data for the page is invalid.
Error Code: 0x8007052e
Notification: BeginRequest
Module: IIS Web Core
Requested URL: http://localhost/
Logon User: Not yet determined
Logon Method: Not yet determined
Handler: Not yet determined
Config Error: Cannot read configuration file
Config File: \?UNCisha2003wwwrootweb.config

Reason:

The error code in this 500.19 error message is 0x8007052e which indicates:

ERROR_LOGON_FAILURE — Logon failure: unknown user name or bad password.

Solution:

To resolve this error, follow the steps given in the KB 934515

***************************************

Scenario 6

Error Message:

HTTP Error 500.19 — Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid. Module DynamicCompressionModule
Notification SendResponse
Handler StaticFile
Error Code 0x8007007e
Requested URL http://localhost:80/
Physical Path C:inetpubwwwroot
Logon Method Anonymous
Logon User Anonymous

Reason:

Error Code 0x8007007e is:

ERROR_MOD_NOT_FOUND — The specified module could not be found.

This problem occurs because the ApplicationHost.config file or the Web.config file references a module that is invalid or that does not exist. To resolve this problem: In the ApplicationHost.config file or in the Web.config file, locate the module reference or the DLL reference that is invalid, and then fix the reference. To determine which module reference is incorrect, enable Failed Request Tracing, and then reproduce the problem.

For above specific error (mentioned in this example), DynamicCompressionModule module is causing the trouble. This is because of the XPress compression scheme module (suscomp.dll) which gets installed with WSUS. Since Compression schemes are defined globally and try to load in every application Pool, it will result in this error when 64bit version of suscomp.dll attempts to load in an application pool which is running in 32bit mode.

This module entry looks like:

<scheme name=»xpress» doStaticCompression=»false» doDynamicCompression=»true»
dll=»C:Windowssystem32inetsrvsuscomp.dll» staticCompressionLevel=»10″
dynamicCompressionLevel=»0″ />

Hence to get rid of this problem:

Ø Remove/Disable the XPress compression scheme from the configuration using the command below:

%windir%system32inetsrvappcmd.exe set config -section:system.webServer/httpCompression /-[name=’xpress’]

OR

Ø Add an attribute of «precondition= «64bitness» for this module entry so that it loads only in 64bit application pools

Refer this blog for more details on Preconditions in IIS7

OR

Ø Use a 32bit version of suscomp.dll

***************************************

Scenario 7:

Error Message:

HTTP Error 500.19 — Internal Server Error

The requested page cannot be accessed because the related configuration data for the page is invalid. Detailed Error Information

Module IIS Web Core

Notification BeginRequest

Handler Not yet determined

Error Code 0x80070021

Config Error: This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault=»Deny»), or set explicitly by a location tag with overrideMode=»Deny» or the legacy allowOverride=»false».

Config File \?C:inetpubwwwrootweb.config

Requested URL http://localhost:8081/

Physical Path C:inetpubwwwroot

Logon Method Not yet determined

Logon User Not yet determined

Config Source

144: </modules>

145: <handlers>

146: <remove name=»WebServiceHandlerFactory-Integrated»/>

Reason:

ERROR CODE: 0x80070021 is

ERROR_LOCK_VIOLATION The process cannot access the file because another process has locked a portion of the file.

Solution:

There are usually a few more lines in that error response that points to the exact line in the config file (and hence the locked section) that has the problem. You will either have to unlock that section or not use it in your application’s web.config file.

For e.g., one can lock/unlock handlers/modules sections by either

Ø use appcmd.exe

%windir%system32inetsrvappcmd unlock config -section:system.webServer/handlers

%windir%system32inetsrvappcmd unlock config -section:system.webServer/modules

OR

Ø manually change value from «Deny» to «Allow» for below settings in %windir%system32inetsrvconfig applicationHost.config

<section name=»handlers» overrideModeDefault=»Deny» />

<section name=»modules» allowDefinition=»MachineToApplication» overrideModeDefault=»Deny»/>

You can also configure the locking via IIS manager UI.

For more details refer: Locking in IIS 7.0 Configuration

In above error message, the error occurred on the handlers section at:

<remove name=»WebServiceHandlerFactory-Integrated»/>”

This usually indicates that ASP.NET is either not installed or has corrupted/incomplete installation because installation of asp.net unlocks that section. Hence if this is the case, one should install asp.net feature from Server Manager (Under Web Server Role in Windows Server 2008 and in Program Features-> Application server in Vista/Windows7). This KB929772 talks about the ASP.NET installation failure reason.

***************************************

Scenario 8

Error Message:

HTTP Error 500.19 — Internal Server Error

Description: The requested page cannot be accessed because the related configuration data for the page is invalid.

Error Code: 0x80070005

Notification: BeginRequest

Module: IIS Web Core

Requested URL: http://localhost

Physical Path: C:Inetpubwwwroot

Logon User: Not yet determined

Logon Method: Not yet determined

Handler: Not yet determined

Config Error: Cannot read configuration file

Config File: \? C:Inetpubwwwrootweb.config

Reason:

The error code 0x80070005 is:

E_ACCESSDENIED — General access denied error

The “Config error” portion of the error may indicate this too, via message: “Config Error Cannot read configuration file due to insufficient permissions ”

Solution:

Grant Read permission to the IIS_IUSRS group for the ApplicationHost.config file or for the Web.config file indicated in the error message. Even if there is no config file at that location, the worker process identity (and/or the IIS_IUSRS group) needs at least Read access to the directory so that it can check for a web.config file in that directory.  If it’s a UNC share, you need to either run your app-pool as an account that has sufficient permission to the UNC share or configure the virtual directory with a user that has sufficient permission to the share.

If you still see the issue, run the Process Monitor tool, reproduce the error and look for “Access Denied” in the “Result” column. You can then configure the required permissions accordingly.

Other Related Articles:
Troubleshooting HTTP 401.3 errors (Access denied) with Process Monitor

Troubleshooting common permissions and security-related issues in ASP.NET

***************************************

Scenario 9

There’s one intermittent 500.19 error we’ve observed while using Shared Configuration with multiple web servers in a load balanced environment and the configuration files stored on a common UNC file share. In this scenario, if the file share content goes offline, the web server will stop responding. Furthermore, when the file share comes up again, the web server will still not detect it and will fail with a 500.19 error. In order to recover from this situation, you must restart IIS. The solution to this problem is described in this KB

***************************************

Other references:

Error message when you visit a Web site that is hosted on IIS 7.0: «HTTP Error 500.19 – Internal Server Error»

You receive an error message when you try to view a Web page from a Web site that uses pass-through authentication in Internet Information Services 7.0

Troubleshoot IIS7 errors like a pro


We are going to explore four potential reasons why your ASP.NET Core Application is not working in IIS.

Now the reason why I’m writing this article is because I’ve had a few people get in contact with me as a result of my article «How to Publish an ASP.NET Core & React SPA to IIS».

They were saying they still couldn’t get their ASP.NET Core application to work in IIS, despite following the recommendations in that article.

So, that’s explore the reasons why this might be the case and come up with some rememdies.

Problem #1: Permissions

So you’ve published your ASP.NET Core application. You’ve set up a website in IIS pointing to your published folder.

Tried to run the application. And then IIS throws an error that reads as follows:

HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.

Config Error: Cannot read configuration file due to insufficient permissions

500.19 Error when Running an ASP.NET Core Application in IIS

500.19 Error when Running an ASP.NET Core Application in IIS

This error is because IIS does not have the correct permissions to render your ASP.NET Core application.

In Windows 10, you need to give full access to the IIS_IUSRS group in the path where you are hosting your ASP.NET Core application in IIS.

Give IIS_IUSRS Full Control to your ASP.NET Core Application in IIS
In Windows 10, give IIS_IUSRS Full Control to your ASP.NET Core Application in IIS

This should resolve your issue.

However, what if that group is not there? Or it doesn’t resolve the issue?

If the group is not there, you can add the Users group to the folder that’s running your ASP.NET Core application in IIS. And give it full permission. That should at least get your application working.

But, it might be that you’ve changed the identity of the application pool in IIS. You might be running your IIS application from a different user.

In which case, in IIS, go to Application Pools and click on the pool running your application.

Go to Advanced Settings… and navigate to Process Model and Identity.

Check the Application Pool Identity in IIS when running an ASP.NET Core Application

Check the Application Pool Identity in IIS when running an ASP.NET Core Application

If you are using a Custom Account, you will probably need to give full permissions to that account as well.

Problem #2: Installing ASP.NET Core Runtime

If you are running an ASP.NET Core application, you must install ASP.NET Core Runtime onto the machine that is running your application through IIS.

You can download ASP.NET Core Runtime from Microsoft’s ASP.NET Core website. It will give you different installers dependent on which operating system you are using.

For IIS, it’s recommended that you install the Hosting Bundle. Not only does this install ASP.NET Core Runtime, but also additional support for IIS runtime support.

Download ASP.NET Core Runtime Hosting Bundle for Windows

For IIS, download the Hosting Bundle from the Windows OS to download ASP.NET Core Runtime & additional IIS runtime support

Problem #3: Different ASP.NET Core Runtime Version

It’s easily done. You’ve successfully deployed your ASP.NET Core application onto IIS and everything is fine.

That is until you upgrade your ASP.NET Core version. You try and deploy it to IIS and then you get a 500 error.

Here is an example of trying to run an ASP.NET Core 3 application with ASP.NET Core Runtime 1 installed.

The error reads:

HTTP Error 500.21 - Internal Server Error
Handler "aspNetCore" had a bad module "AspNetCoreModuleV2" in its moudle list

500.21 Error when Running an ASP.NET Core 3 Application with ASP.NET Core Runtime 1

500.21 Error when Running an ASP.NET Core 3 Application with ASP.NET Core Runtime 1

Now I must stress that you might not get any error when you upgrade your ASP.NET Core version for your application without upgrading your ASP.NET Core Runtime.

But, it’s worth keeping it up to date.

Problem #4: A Runtime Error With Your Application

This one was raised by Chaker Aich on my YouTube channel.

So you’ve tried all these solutions, but you are still getting a 500 error.

This one is more specific as it relates to a start up failure.

HTTP Error 500.30 - ANCM In-Process Start Failure

500.30 Error when Running an ASP.NET Core Application in IIS

500.30 Error when Running an ASP.NET Core Application in IIS

This is a problem with your ASP.NET Core application rather than IIS. There is a runtime error.

First, check that it runs locally on your machine. Assuming you are using Visual Studio, open the application in Visual Studio and run the application.

If it throws an error, you will know the reason why you are getting a 500.30 error in IIS.

However, if it’s working fine, there is probably something wrong with the IIS environment. Maybe the server cannot see the database? Or maybe, there is something that hasn’t been installed on the server?

To help you identify the issue, you can turn on log files.

In the directory that is running your ASP.NET Core application in IIS, you should have a web.config file.

In there, you should have an aspNetCore tag with a stdoutLogEnabled and stdoutLogFile attribute.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath="dotnet" arguments=".RoundTheCode.ReactSignalR.dll" stdoutLogEnabled="false" stdoutLogFile=".logsstdout" hostingModel="inprocess" />
    </system.webServer>
  </location>
</configuration>

Now the stdoutLogEnabled attribute should be set to false. By setting that to true, you should be able log the runtime error that you are getting in your application.

The log files are stored in the folder path that is contained in the stdoutLogFile attribute.

Still Stuck?

If you are not quite following the solutions to the fixes, you can watch us demonstrate these errors and applying fixes.

We go ahead and publish our ASP.NET Core application to a folder, ready for IIS to host.

Afterwards, we set the appropriate permissions that IIS needs to render your ASP.NET Core application.

Then, we go ahead and install the ASP.NET Core Runtime onto our machine.

Lastly, we demonstrate the checks you can use to deal with any runtime errors you are getting when running your ASP.NET Core application in IIS.

I need help for a client and am willing to pay a professional if need be.  I just opened an account with a web host and had the developer upload the site and we are getting an error while accessing the site.  We are running IIS 7.5 and getting
a 500.19 error code 0x8007000d pointing to the web.config file.

Here is the contents of the web.config file.  We are getting an error pointing to line 54 which is the </system.web> which is 6 lines from the bottom of the file.

PLEASE if you have any suggestions or fixes, let  me know how to do this. If you would like to contact me my email is mike@tuprox.com.  Much thanks in advance!

<?xml version=»1.0″ encoding=»UTF-8″?>

<!—
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  —>

<configuration>
  <connectionStrings>
    <add name=»ApplicationServices»
         connectionString=»data source=.SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true»
         providerName=»System.Data.SqlClient» />
  </connectionStrings>

  <system.web>
    <compilation debug=»true» targetFramework=»4.0″ />

    <authentication mode=»Forms»>
      <forms loginUrl=»~/Account/Login.aspx» timeout=»2880″ />
    </authentication>
<customErrors>

<configuration>
    <system.web>
        <customErrors mode=»RemoteOnly» defaultRedirect=»mycustompage.htm»/>
    </system.web>
</configuration>

    <membership>
      <providers>
        <clear/>
        <add name=»AspNetSqlMembershipProvider» type=»System.Web.Security.SqlMembershipProvider» connectionStringName=»ApplicationServices»
             enablePasswordRetrieval=»false» enablePasswordReset=»true» requiresQuestionAndAnswer=»false» requiresUniqueEmail=»false»
             maxInvalidPasswordAttempts=»5″ minRequiredPasswordLength=»6″ minRequiredNonalphanumericCharacters=»0″ passwordAttemptWindow=»10″
             applicationName=»/» />
      </providers>
    </membership>

    <profile>
      <providers>
        <clear/>
        <add name=»AspNetSqlProfileProvider» type=»System.Web.Profile.SqlProfileProvider» connectionStringName=»ApplicationServices» applicationName=»/»/>
      </providers>
    </profile>

    <roleManager enabled=»false»>
      <providers>
        <clear/>
        <add name=»AspNetSqlRoleProvider» type=»System.Web.Security.SqlRoleProvider» connectionStringName=»ApplicationServices» applicationName=»/» />
        <add name=»AspNetWindowsTokenRoleProvider» type=»System.Web.Security.WindowsTokenRoleProvider» applicationName=»/» />
      </providers>
    </roleManager>

  </system.web>

  <system.webServer>
     <modules runAllManagedModulesForAllRequests=»true»/>
  </system.webServer>
</configuration>

If your Internet Information Services (IIS) produces a 500 – Internal server error, your website is in serious trouble. Debugging an IIS 500 – Internal server error can take some time, so you’d better be prepared for the worst-case scenario. You don’t want to research how to deal with this error under time pressure.

Contents

  1. Cause of 500 – Internal server error
  2. Debugging an IIS 500 – Internal server error
  3. Resolving an IIS 500 – Internal server error
  4. Common 500.x substatus codes
  • Author
  • Recent Posts

Surender Kumar has more than twelve years of experience in server and network administration. His fields of interest are Windows Servers, Active Directory, PowerShell, web servers, networking, Linux, virtualization, and penetration testing. He loves writing for his blog.

Latest posts by Surender Kumar (see all)

  • Extending LVM space in Ubuntu — Thu, Feb 2 2023
  • Backup in Proxmox VE — Thu, Jan 26 2023
  • Snapshots in Proxmox VE — Wed, Jan 25 2023

In my previous posts, you learned about detailed errors and failed request tracing in IIS (Internet Information Server). I recommend reading those articles first before you proceed with this one.

Cause of 500 – Internal server error

This is the most common error you will encounter with any website hosted with IIS. In most cases, a developer messed up. Thus, the fastest way is often to simply reverse the last action taken, such as restoring an earlier version of your web application. Once your system is running again, you can investigate the cause of the error on your test side in peace.

500 Internal server error

500 Internal server error

The HTTP 500 error is a server-side error. While we understand that the problem is on the server end, the error is usually ambiguous. It doesn’t exactly tell the administrator what is wrong with the server. Thus, debugging a 500 – Internal server error often takes some time.

Debugging an IIS 500 – Internal server error

Since the above error doesn’t really tell what’s actually wrong with the server, we need to enable detailed errors, as discussed in my previous post. Once detailed errors are enabled, you will see more detailed error information, including an HTTP substatus code. Sometimes even the detailed errors don’t show any useful information right away. For example, see the following screenshot:

The page cannot be displayed because an internal server error has occurred

The page cannot be displayed because an internal server error has occurred

Here I am getting: The page cannot be displayed because an internal server error has occurred. There is no HTTP status code or substatus code listed on the error page. If you get such an error even when detailed errors are enabled, right-click anywhere in the browser window and select Inspect (or press F12).

Opening developer tools in web browser to reveal server errors

Opening developer tools in web browser to reveal server errors

This opens the developer tools in your browser window. Now, click the Console tab. The actual error thrown by the web server is displayed.

Viewing server errors using the Console tab of the web browser's developer tools

Viewing server errors using the Console tab of the web browser’s developer tools

To further understand the exact cause of 500 errors, enable Failed Request Tracing, as discussed in my previous post. Now, try to replicate the problem. If you can replicate it, open the newly generated XML log file in a web browser. The following screenshot shows the actual cause of a 500 – internal server error with a substatus code of 19 (HTTP 500.19 error):

Determining the cause of a 500 error using the Failed Request Tracing log file

Determining the cause of a 500 error using the Failed Request Tracing log file

Usually, substatus code 19 indicates that the configuration data is invalid. This could be due to some malformed or unidentified element in a server-level config file (ApplicationHost.config) or website-level config file (web.config). If you take a closer look at the ConfigExceptionInfo field of the log file, you will find the exact line number (6 in our case) in the web.config file that caused the exception. Now let’s take a look at the web.config file itself.

Viewing the problematic element in the web.config file

Viewing the problematic element in the web.config file

Here, you can see that the developer tried to add a mime type in the config file, but it was already defined in the server-level configuration file (i.e., ApplicationHost.config). Therefore, the Cannot add duplicate collection entry of type ‘mimeMap’ with unique key attribute ‘fileExtension’ set to ‘.mp4’ exception was returned. Furthermore, if there is some unidentified element, a syntax error, or even a typo in the web.config file, you will most likely get a similar error.

Resolving an IIS 500 – Internal server error

To resolve an IIS 500 – Internal server error, you could simply remove the line that is causing the exception. Alternatively, if you don’t want to remove this line for some reason, add the following code right above line 6 in web.config:

<remove fileExtension=".mp4" />

By doing this, you are essentially overriding the server-level element. In the end, your web.config file should look as shown below:

Overriding the server level mime element with web.config file

Overriding the server level mime element with web.config file

Now refresh the page, and the error should go away. This was just one example of resolving a 500.19 error. If you get a 500 error with a different substatus code, use the same approach to troubleshoot the problem.

Common 500.x substatus codes

The following table covers some of the most common HTTP 500 substatus codes, along with their probable causes and troubleshooting advice:

Subscribe to 4sysops newsletter!

Status Code Probable Cause Troubleshooting Advice
500.11 The application is shutting down on the web server The application pool is shutting down. You can wait for the worker process to finish the shutdown and then try again.
500.12 The application is busy restarting on the web server This is a temporary error and should go away automatically when you refresh the page. If the error persists, something is wrong with the web application itself.
500.13 The web server is too busy This error indicates that the number of incoming concurrent requests exceeded the number that your IIS application can process. This could be caused when the performance settings are not right. To troubleshoot such issues, a memory dump needs to be captured and analyzed using tools such as Debug Diagnostic.
500.15 Direct requests for Global.asax file are not allowed A direct request was made for the Global.asa or Global.asax file, which is not allowed by the web server
500.19 The configuration data is invalid We already covered how to fix this error above
500.21 The module not recognized This status code is caused by a partial installation of the IIS server, such as missing ISAPI modules. To fix this error, identify the missing IIS components and install them.

Once you troubleshoot the problem, don’t forget to disable Failed Request Tracing and revert the detailed errors to custom errors on your web server.

So you just moved your application to an IIS7 server, and now you are getting an error when you make a request to it.  This seems to be a popular theme on IIS.NET forums these days, and after answering a hundred or so of these posts, I figured I should do something to help people track down and fix their issues with a little less frustration. 

Dealing with 500, 503 IIS errors? These are likely hiding bigger application issues that are hurting your application.   

It can be very hard to link generic IIS errors to underlying issues that you can fix. Head over to LeanSentry to get a comprehensive application checkup. We’ll find your actual IIS and ASP.NET issues, and even show you how to fix them in code.

Server software, and web servers specifically, are very complex and highly configurable systems that support multi-tier applications using a variety of technologies and subsystems, and endure further complexity due to security, performance, and reliability demands, so it’s a wonder it all works as well as it does in the end.  IIS7 strives to improve the experience of diagnosing and solving problems when they do occur, so knowing how to use the new IIS7 diagnostics features can come a long way in helping you become a pro at troubleshooting server problems.

First things first – what’s the problem?

I often find myself asking this question on the forums when someone posts something like “Help, I moved to IIS7 and now my application doesn’t work!”.  Huh, what doesnt work? When your site stops working, the first thing you need to do is determine what the error actually is before we can move any further.  IIS7 has much better error messages that will often tell you exactly what the problem is, and help you fix it.

Unfortunately, sometimes getting to this error is the main challenge.  Let’s look at a few things you may need to do to get there:

1) Disable IE “Friendly HTTP error messages”
IE will by default replace the actual error messages coming from the server with a “friendly” error message, which hides the error contents we need to see.  For example, for a 404 Not Found error, you may instead see the following:

IE Friendly Error

 To disable this and see the real error coming from the server, you need to go to “Tools > Internet Options”, choose the Advanced tab, and clear the “Show friendly HTTP error messages” checkbox.  Then, close the browser, open it again, and re-request the page.

Disable IE friendly HTTP error messages

Now, suppose you are still seeing the generic “cannot display the webpage” or “page not found” error.   This is typically caused by IE failing to connect to your website, so there is no server error message to look at here.  I have a detailed guide to troubleshooting this condition here: Where did my IIS7 server go? Troubleshooting “server not found” errors.

An aside: If you don’t want to mess with IE for troubleshooting (especially if you suspect you are getting cached pages, due to IE’s super- aggressive caching), the best thing to do is break out a trusty simple http tool of choice and make the request with it.  I recommend WFETCH, which is included in the IIS6 Resource Kit tools (you can install on XP/Windows 2003 only, and can either run it from there or copy wfetch.exe to your Vista/LHS box).

2) Enable IIS7 detailed errors
IIS7 introduces a new custom errors feature, which by default hides the error responses issued by the server to remote clients, replacing them with a basic error message.  This is critical for security of your site, as errors frequently contain sensitive information that you don’t want others to see, but makes getting to the bottom of the problem harder since you cannot see those very error details. So, if you are requesting your site from another machine, you may still get a basic error that looks like this:

IIS7 custom error page

You have two options here:

1) Make the request locally from the server machine

By default, you will get the detailed error.

2) Enable detailed errors for remote clients.  
First, if your error is an ASP.NET exception (you can tell if it says “Runtime Error” and has the framework version), please be aware that ASP.NET overrides the IIS custom error mechanism with its own implementation of custom errors, so you should turn the ASP.NET custom errors off to see detailed ASP.NET exceptions.  You DO NOT have to configure IIS7 custom errors for ASP.NET exceptions (it would be silly to have to do it in two places).  To turn off ASP.NET custom errors, place the following in your web.config:

<system.web>
   <customErrors mode=”Off” />
</system.web>

If the error is not an ASP.NET error, turning off IIS7 custom errors will allow error responses from your application to be sent to remote clients without being censored by the IIS7’s custom errors module.

You can do this from the IIS7 Admin tool by running “Start>Run>inetmgr.exe”, selecting your website/application/virtual directory in the left-hand tree view, clicking on the “Error Pages” icon, clicking “Edit Feature Settings” action, and then selecting “Detailed Errors”.

Enable IIS7 Detailed Errors

You can alternatively do this from an elevated command line prompt (Run as Administrator):

> %windir%system32inetsrvappcmd.exe set config “Default Web Site/yourapp” /section:httpErrors /errorMode:Detailed

Where “Default Web Site” should be replaced with your site’s name if different, and “/yourapp” with the virtual path you’d like to enable detailed errors for.

NOTE: When you are done debugging, please return the settings back to custom errors for remote requests, or the security of your website may be compromised.  Here is how to do it with AppCmd:

> %windir%system32inetsrvappcmd.exe set config “Default Web Site/yourapp” /section:httpErrors /errorMode:DetailedLocalOnly

 
Now, you should be getting detailed errors back – for example, the error I was getting before now looks like this (this is the Vista error page – Longhorn Server and Vista SP1 error pages will look much nicer, see this for an example):

IIS7 Detailed Error Page

Notice that this error contains quite a bit of useful information:
1) The heading contains the substatus code, 404.0, which is an IIS specific code that further describes the problem.  The majority of common errors has a unique <status_code>.<substatus_code> combination that you can easily google for additional information.
2) The page indicates what module (IIS Web Core), and in what notification (MapRequestHandler) an error occurred.  This information is critical whenever you are debugging server problems, especially on the IIS7+ world when most of them occur in one of the modules that take part in the processing of the request.
3) The page shows you some useful request information, such as the requested url and the physical path to which it resolved.  Most 404 errors will be resolved right here, by seeing that the request is being made to a wrong url or resolving to a wrong physical path due to incorrect virtual directory mapping.
4) The “most likely causes” and “what you can try” sections offer the most likely explanation for the error and what you can do about it.  They are dead on for the majority of common IIS7 errors.

NOTE: When you are coming to the forums with an error, we expect you to have gotten this far and that you will provide the detailed error to help us with your problem.  For more information about the custom errors support in IIS7, check out http://www.iis.net/articles/view.aspx/IIS7/Managing-IIS7/Diagnostics-in-IIS7/Deciphering-Error-Messages/How-to-Use-HTTP-Detailed-Errors-in-IIS7.

3) Detour – the 503 “Service Unavailable” error
Sometimes, you will get an error that looks like this:

503 Service Unavailable

This error most likely either indicates a critical misconfiguration of the server that is causing IIS to fail to start a worker process/process your request, or a system overload condition that is causing requests to be rejected early, so no further error information will be available in the response.  If you are getting this error, please follow my detailed guide: Where did my IIS7 server go? Troubleshooting “service unavailable” errors.

Deeper diagnostics with Failed Request Tracing (formerly known as FREB)

If the error alone is not sufficient to diagnose the condition, or more information is needed to determine what lead up to the error occurring, or, there is no error (for example, request times out), you can take advantage of the wonderful IIS7 feature called “Failed Request Tracing”.

This feature can be used to generate a detailed trace of events leading up to the failure, much like ETW, but now with more/more useful events and significantly easier to turn on and use for troubleshooting.

More importantly, you can configure Failed Request Tracing to only trace requests that encounter a specific failure condition, such as a specific response status/substatus codes, an event of specific verbosity, or a timeout.

To do this, you are going to need to install it first (if you haven’t already):
On Vista: Control Panel, Programs, Turn Windows Features on or off, check Internet Information ServicesWorld Wide Web ServicesHealth and DiagnosticsTracing.
On Windows Server 2008: Start>Run>Server Manager, Roles, Web Server(IIS),  Add Role Services, check Web ServerHealth and DiagnosticsTracing

Then, to enable IIS to generate these logs, you need to do two things:
1) Enable Failed Request Tracing for the site you want to trace

In InetMgr, select your site in the left-hand tree view, then under Actions on the right click “Failed Request Tracing …”.  There, select the Enable box.

Enable Failed Request Tracing for a site

2) Create a Failed Request Tracing rule with the events and failure definition of choice

In InetMgr, select the site/application/virtual directory that you’d like to trace in the tree view, click the “Failed Request Tracing Rules” icon, click the “Add…” action, and follow the wizard to create the rule.

You will be asked what content you’d like to trace (based on an extension), when to consider the request as failed (a list of response status codes, and in Longhorn Server, also event verbosity) or a timeout, and finally the events you’d like to trace.  I recommend to leave all events selected by default, unless you are sure you know what you are looking for.

Create a Failed Request Tracing rule

Now, when you make a request, if it meets the failure definition, the detailed trace will be logged as an XML file that you can inspect (or send to us for inspection). 

You can by default find this file in %systemdrive%inetpublogsFailedReqLogFilesW3SVC<ID> folder. 

If you double-click this file, it will open with the provided XSL stylesheet that shows the trace events.  In Longhorn Server, this stylesheet has gotten a major overhaul to highlight the important information better – for more information, see this: http://blogs.iis.net/bills/archive/2006/10/19/Making-Failed-Request-Tracing-More-Approachable.aspx.  You can download the new stylesheet and use it today for your Vista machine.

The Failed Request Tracing log provides verbose execution information for the request, that can be used in a number of ways to further diagnose more complex problems that may result from the operation of more than one module.  For example, if a url rewriter module changes a url in the request, which later leads to the static file handler failing to find the file, the SetUrl event can provide the needed information.  The log also provides such key info as the times taken by each module to execute, the outcome of each of the built-in module’s operation (often including the reason why something didn’t work), and any times when a module fails a request by setting an error response status code.

Finally, one of the main strengths of Failed Request Tracing is that you do not have to be the client to receive the error information.  As an administrator, you can configure it to monitor for errors and log the forensic trace when they occur, allowing you to just leave the feature on in production.  Think of it as request logs on steroids.  To learn more about Failed Request Tracing, see http://www.iis.net/articles/view.aspx/IIS7/Managing-IIS7/Diagnostics-in-IIS7/Using-Failed-Request-Tracing/Troubleshooting-Failed-Requests-using-Tracing-in-I.

I will post more specific strategies on how to troubleshoot with Failed Request Tracing logs in a future post.  In the meantime, you should now be a lot more prepared to deal with errors when they occur, and resolve them before you type that first forum post.  And if you do make a post (which you are welcome to do), you’ll be able to provide us with the key information to help you solve your problem.

Thanks,

Mike

Понравилась статья? Поделить с друзьями:
  • Ilok server error
  • Ilo4 self test error
  • Ilo 4 has detected a self test error что это такое
  • Iis logs 500 error
  • Ilo 4 has detected a self test error как исправить