Reputation: 2858
My application is experiencing this really weird issue. In one of my controllers I have an action with both HttpGET
and HttpPOST
annotations. The difference between them is that the HttpPOST
action receives a model parameter. Other parameters are strings and nullable booleans. randomly out of nowhere as I dig through the Error Logs of my application I am finding The following exception, a public action method was not found on controller
. If you make a GET request on that URL the view is returned even if you do not pass any parameters, the same things goes for the POST. I cant really think of what can be going on. The problem is on just this action. Can it be caused by publishing ? I mean I use web deploy to publish the website major changes are made twice in a week and minor changes are made twice in a day. But I'm getting this exception 10 times in a day maybe even more. and application health is really suffering from this. I get major CPU usage jumps. What can I do to troubleshoot this ?
Upvotes: 0
Views: 1749
Reputation: 3816
You say the get has nullable booleans. do you pass empty values to those in your get requests? otherwise it will not work.
for example
public ActionResult GetMyData(string name, bool? isItTrue){
return View()
}
your request has to be like this even isItTrue
is null
http://localhost/controller/getmydata?name=me&isItTrue=
Upvotes: 1