В процессе разворачивания WebForm на IIS я столкнулась с проблемами, решением которых хочу поделиться в этой заметке.
Ошибка: Config Error
Cannot read configuration file due to insufficient permissions
Решение:
Для решения этой проблемы нужно выдать права на чтение папки с сайтом для пользователя IIS_IUSRS.
Ошибка: HTTP Error 401.3 - Unauthorized
HTTP Error 401.3 - Unauthorized You do not have permission to view this directory or page because of the access control list (ACL) configuration or encryption settings for this resource on the Web server. IIS
Решение:
Проверить, включен ли анонимный доступ для этого сайта – раздел IIS Autentification.
Перейти в папку, где лежит сайт, и выдать в ней права пользователю IUSR на чтение.
Второй возможный вариант: Besides enabling Anonymous Authentication for the web site, I had to go a step further and Edit Anonymous Authentication (by right clicking) and change it from a Specific User to Application pool identity.
Ошибка: This assembly is built by a runtime newer[…]
Could not load file or assembly 'Interop.TSObjectLibrary' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. IIS
Решение:
В окне IIS Manager перейти на Application Pool, в появившейся таблице выбрать наш сайт, дважды кликнуть на его записи и изменить версию .NET на подходящую нам.
Ошибка: HTTP Error 500.21
HTTP Error 500.21 - Internal Server Error Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list
Решение:
Лично мне помогло aspnet_regiis.exe –i .
Подробно возможные пути решения проблемы описаны ниже.
After setting up a new Windows 7 computer with IIS 7.5 and Visual Studio 2010, I tried to start my ASP.NET 4.0 website using the Local IIS web server. However, right off the bat I was hit with the following IIS error message:
- HTTP Error 500.21 - Internal Server Error Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list.
I knew the website worked correctly, because it ran fine in the Visual Studio Development Server, just not in IIS 7. Apparently, the reason I was recieving the Internal Server error message was that I had installed SQL Server 2008, after installing Visual Studio 2010, and because of this it corrupted the IIS Machine level configuration files ("If you install VS2010 and then install VS2008 and VS2008 SP1, the configuration files for ASP.NET in IIS only include about 1/2 of the correct .Net 4.0 configuration sections." read more here).
To repair this problem I ran a full silent repair of the .NET Framework 4.0. Here's how on either a 32 bit or 64 bit computer:
- Click Start -> All Programs -> Accessories -> Run
- In the Open textbox paste in the following line (see list of all .NET Framework version install, repair and unistall command lines here):
For silent repair on 32 bit computer with .Net Framework version 4.0.30319 use:
-
%windir%\Microsoft.NET\Framework\v4.0.30319\SetupCache\Client\setup.exe /repair /x86 /x64 /ia64 /parameterfolder Client /q /norestart
- %windir%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\Client\setup.exe /repair /x86 /x64 /ia64 /parameterfolder Client /q /norestart
- Click OK to start the repair
- After, the repair ran for a few minutes, I restarted IIS 7.5, and things began to work correctly!
Hopefully, that will work for you...
Some people also seem to be having success correcting this error by running aspnet_regiis.exe. I initially tried this and it did not work for me, but feel free to give it a shot. (Keep in mind for the example below I have .Net Framework version 4.0.3.0319 installed on my computer, but you may need to change directory version to what is installed on your computer): Here's how to run aspnet_regiis.exe:
- Run "aspnet_regiis.exe" program from command line (within Command Prompt):
- %windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe –i
- If you want to open it using the Run program, just type in "Run" in the Windows 7 search box, then use the following line below in the Open box, then click OK:
- %windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe –i
- Note if your computer is 64 bit, then I would change the line to:
- %windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe –i
Hopefully, these solutions help get you up and running and fix the IIS7 error... Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list.
Ошибка: An attempt was made to load a program with an incorrect format.
Could not load file or assembly 'Interop.TSObjectLibrary' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Решение:
В окне IIS Manager перейти на Application Pool, в появившейся таблице выбрать наш сайт. Нажать правую кнопку, выбрать там Advanced Settings и в появившемся окне выставить параметр «Enable 32-Bit Applications» в значение True.
Ошибка: Windows Authentication not allowed
Решение:
В настройках IIS Аутентификация (на уровне сервиса, самый верхний) – разрешить аутентификацию с помощью Windows Autentification. Все остальные способы – запретить.
На уровне сайта – повторить процедуру, запретив все способы аутентификации кроме Windows Autentification.
Ошибка: Object 'Configuration' is not assigned
Решение:
Проверить, прописан ли путь к файлам конфигурации продуктов TERRASOFT в файлах RunSettings бинарников.
Если прописан - перейти в папку, где лежат конфигурационные файлы программного обеспечения TERRASOFT (пример: «%APPDATA% Terrasoft»), и выдать на нее права пользователю IUSR и IIS_IUSR на чтение.