“The type or namespace name 'Route' could not be found” using “attribute routing”

后端 未结 4 2175
栀梦
栀梦 2021-02-19 08:57

Just trying to splice some code from one working project to another. The \"from\" project uses \"attribute routing\" where you embed [Route(…)] directives in the W

4条回答
  •  闹比i
    闹比i (楼主)
    2021-02-19 09:41

    In my case, in web api project there were two using references:

    using System.Web.Http;
    using System.Web.Mvc; 
    

    As soon as I removed System.Web.Mvc, the error was gone.

提交回复
热议问题