How to get IIS to recognize OWIN startup class?

后端 未结 4 1398
庸人自扰
庸人自扰 2020-12-24 11:47

My OWIN web service runs beautifully in Visual Studio 2013, but when I publish it to a real IIS site, it acts as if the Configuration method in the startup class has not bee

4条回答
  •  温柔的废话
    2020-12-24 12:44

    I also had to add an extra setting to my web.config

        
        
                   
         
    
    

    From: https://katanaproject.codeplex.com/wikipage?title=Static%20Files%20on%20IIS

    IIS has a native static file module that is optimize to skip other portions of the pipeline if it sees file paths that do not match other handlers (e.g. not aspx). This means that the directory browser middleware is likely to work, but then the static file middleware may be bypassed in favor of the native static file module.

    This tells IIS not to skip the managed Asp.Net modules even if the native static file module thinks it has a match.

    It also describes another step, but this was not needed for me:

    Also, add the following stage marker AFTER your static file middleware (in namespace Microsoft.Owin.Extensions): app.UseStageMarker(PipelineStage.MapHandler);

提交回复
热议问题