我开发了一个Web Api,我在已经托管我的Web应用程序(www.mydomain.com)的服务器上创建了一个目录/文件夹(myWebApi)。我在该文件夹 myWebApi 中托管/上传了该网络API,当我尝试访问时
www.mydomain.com/myWebApi/api/mycontroller/action
返回404错误
HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
这是我的WebApiConfig
config.MapHttpAttributeRoutes();
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "myWebApi/api/{controller}/{action}/{id}",
defaults: new { id = RouteParameter.Optional }
);
config.Routes.MapHttpRoute(
name: "DefaultApi1",
routeTemplate: "api/{controller}/{action}/{id}",
defaults: new { id = RouteParameter.Optional }
);
请给我解决方案。