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

前端 未结 4 1948
长情又很酷
长情又很酷 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:18

    I was receiving this issue with a combination of a [RoutePrefix] and a [Route] on an action.

    [RoutePrefix("/api/my/application")]
    

    on the action I had

    [HttpPost, Route("{someVariable:int}"]
    

    When I changed: [RoutePrefix("/api/my/application")]to[RoutePrefix("api/my/application")] everything was fine.

提交回复
热议问题