Я получаю сообщение об ошибке при запуске приложения.Ошибка при работе с HTTP-модулем - обнаружен параметр ASP.NET, который не применяется в режиме интегрированного управляемого конвейера
An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.
Я создал модуль HTTP, который считывал информацию из заголовка запроса и записывал данные в файлы cookie. Вот код.
namespace My.Web
{
public class UserIdModule : IHttpModule
{
private HttpApplication httpApp;
public void Init(HttpApplication application)
{
application.BeginRequest += (new EventHandler(this.Application_BeginRequest));
}
private void Application_BeginRequest(Object source, EventArgs e)
{
// Create HttpApplication and HttpContext objects to access
// request and response properties.
HttpApplication application = (HttpApplication)source;
HttpContext context = application.Context;
//Read header
string userId = context.Request.Headers["user_id"];
if (string.IsNullOrEmpty(userId))
{
userId = "guest";
}
//Create and write cookie
HttpCookie userCookie = new HttpCookie("userId", userId);
userCookie.Expires = DateTime.Now.AddYears(5);
context.Response.Cookies.Add(userCookie);
}
public void Dispose() { }
}
}
В моей web.config
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".*" mimeType="application/octet-stream" />
</staticContent>
<!-- To register the module for IIS 6.0 and IIS 7.0 running in Classic mode -->
<modules>
<add name="UserIdModule" type="UserIdModule"/>
</modules>
</system.webServer>
<system.web>
<compilation targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<!-- To register the module for IIS 7.0 running in Integrated mode -->
<httpModules>
<add name="UserIdModule" type="UserIdModule"/>
</httpModules>
</system.web>
</configuration>
Это скриншот ошибки:
Проверьте эти http://stackoverflow.com/questions/7370513/http-error-500-22-internal-server-error-an-asp-net -setting-has-detected, http://stackoverflow.com/questions/4209999/an-asp-net-setting-has-been-detected-that-does-not-apply-in-integrated-managed-p – malkam