HttpContext.Response.Filter

后端 未结 2 2080
花落未央
花落未央 2020-12-30 07:34

Currently using asp.net mvc 3 VS 2010. Just installed VS 2013 and now our custom filter is not working. When the page is rendered it just displays a blank page. The filter h

相关标签:
2条回答
  • 2020-12-30 08:30

    After a long digging around I noticed that VS2013 come with a new addition; SignalR - which as it turns out is associated with the ArteryFilter problem.

    So, in order to solve this problem, uncheck the "Enable Browser Link" feature next to your Debug button and voila; filters works as expected again. Still weird that VS2013 does not chain filters.

    Uncheck the "Enable Browser Link"

    Also, note that this is a general ASP.NET feature and hence not limited to MVC.

    PRESERVED FOR HISTORY - ANSWER IS ABOVE

    I am experiencing the same thing but so far it seems related to the new IISExpress and not VS2013 perse. What worked fine in VS2012 suffers the same fate as the one introduced by installing VS2013.

    When executed through normal IIS the problem disappears, hence your code is working fine. Let me know if you find a way to disable this {Microsoft.VisualStudio.Web.PageInspector.Runtime.Tracing.ArteryFilter}.

    Further investigation shows that the applicationhost.config (typically located in %USERPROFILE%\documents\IISexpress\config) indeed is changed by VS2013. I have a backup renamed to ApplicationHost.config.20120825120333.bak. The solution to this mystery is somehow hidden within this configuration change.

    A direct restore of the config make IISExpress unable to start from VS2013.

    ONE NOT-SO-GOOD SOLUTION:

    You can turn debug off (equivalent to CTRL+F5), and IISExpress will act and work as expected. Enabling debug will once again introduce the feature that this entry is about.

      <system.web>
        <compilation targetFramework="4.5" debug="false"/>
        <httpRuntime targetFramework="4.5"/>
      </system.web>
    
    0 讨论(0)
  • 2020-12-30 08:36

    We just hit this issue in VS 2015.

    To add to Michael's answer, the most elegant solution IMHO is to disable browser link feature in web.config, so it works for all developers without additional manual step.

    <appSettings>
        <add key="vs:EnableBrowserLink" value="false"/>
    </appSettings>
    

    More details on the feature and how to disable it @http://www.asp.net/visual-studio/overview/2013/using-browser-link#disabling

    0 讨论(0)
提交回复
热议问题