The route template separator character '/' cannot appear consecutively - Attribute routing issue

前端 未结 4 1890
长情又很酷
长情又很酷 2021-02-05 01:04

The configuration has nothing to do with the error

This is my configuration for the Web API in App_Start/WebApiConfig.cs:

public static void Register(H         


        
4条回答
  •  长发绾君心
    2021-02-05 01:42

    I got the same error however it was caused by the ActionName attribute in my case.

    [ActionName("")]
    public void Get(string code)
    

    Although this broke the Help pages I was still able to reach the endpoint api/controller?code=123. When I removed the ActionName attribute the error disappeared.

提交回复
热议问题