2017-05-10 5 views
2

私は古典的なaspアプリケーションをmvc 4.5の上に構築しており、古典的なaspページの呼び出しを傍受しようとしています。方法の任意のアイデア。ミドルウェアをこれらの要求を傍受させる方法がわからない。このように見えるCan't find method app.UseStaticFiles()は似ていますが、モジュールを使用していました。私はミドルウェアを使用できるようにしたいと思います。OWIN/Katanaミドルウェアの古典的なaspページパイプラインをスキップ

どのような考えですか? startup.csに

using System; 
    using System.Threading.Tasks; 
    using Microsoft.Owin; 
    using Owin; 
    using System.Web; 
    using System.IO; 
    using Microsoft.Owin.Extensions; 
    using Microsoft.Owin.Security.Cookies; 
    using Microsoft.Owin.Security.WsFederation; 
    using Microsoft.Owin.Security; 
    using Microsoft.IdentityModel; 
    using System.Web.Helpers; 
    using System.Security.Claims; 
    using System.Collections.Generic; 
    using System.Security.Principal; 
    using System.Threading; 
    using System.Web.Mvc; 

    public void Configuration(IAppBuilder app) 
    { 
     // For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=316888 
     ConfigureAuth(app); 

    } 

    private void ConfigureAuth(IAppBuilder app) 
    { 
     app.Use(typeof(LogMiddleware)); 
     app.UseCookieAuthentication(new CookieAuthenticationOptions() 
     { 

      CookieSecure = CookieSecureOption.Always, 
      LoginPath = new PathString("/Account/Login"), 
      ExpireTimeSpan = TimeSpan.FromMinutes(30), 
      CookieDomain = MvcApplication.CookieDomian, 
      CookiePath = MvcApplication.ApplicationPath, 
      CookieName = "asp.net", 
      CookieHttpOnly = true, 
      AuthenticationMode = AuthenticationMode.Active, 
     } 
     }); 



     app.UseStageMarker(PipelineStage.Authenticate); 

     app.MapWhen(
      context => context.Request.Path.ToString().EndsWith(".asp"), 
      appBranch => 
      { 
       System.Diagnostics.Debugger.Break(); 
      }); 
     app.Use(typeof(ResponseHeaderMiddleware)); 
+2

startup.csを共有してください –

+1

Owinの古典的なASPです。私はあなたの勇気に拍手を送る。 – Amy

+0

私は努力しています。選択肢ではありませんが、そのような呼び出しを傍受することはありません。私はそれが、owinの全体のポイントがIISから降りることであるという事実と関係していると考えています。私がカスタムHTTPモジュールをowin middle wareと混在させることができないのかどうかわかりません – bdawg

答えて

0

runallmanagedmodulesforallrequestsを追加

は...ウェブの設定でfalseに設定されている

は、これをtrueに設定し、それが動作します...推測しているだろう誰。