Intermittent asp.net mvc exception: “A public action method ABC could not be found on controller XYZ.”

后端 未结 13 704
春和景丽
春和景丽 2020-12-02 04:57

I\'m getting an intermittent exception saying that asp.net mvc can’t find the action method. Here’s the exception:

A public action method \'Fill\' cou

13条回答
  •  爱一瞬间的悲伤
    2020-12-02 05:34

    We found the answer. We looked into our web logs. It showed that we were receiving some weird http actions (verbs/methods) like OPTIONS, PROPFIND and HEAD.

    This seems to the cause of some of theses exceptions. This explains why it was intermittent.

    We reproduced the issue with the curl.exe tool:

    curl.exe -X OPTIONS http://localhost/v2.3.1.0/(S(boztz1aquhzurevtjwllzr45))/Form/Fill/273
    curl.exe -X PROPFIND http://localhost/v2.3.1.0/(S(boztz1aquhzurevtjwllzr45))/Form/Fill/273
    curl.exe -X HEAD http://localhost/v2.3.1.0/(S(boztz1aquhzurevtjwllzr45))/Form/Fill/273
    

    The fix we used was to add an authorization section to web.config:

    
      
    
    

提交回复
热议问题