0
1. Create empty project, click checkbox for Web API and Test project
(probably optional)
2. In WebApiConfig.cs, clear out Register contents, set to
config.MapHttpAttributeRoutes();
3. Create Controller:
public class TestController
{
[HttpGet("test")]
public string GetVal()
{
return "Testing";
}
}
4. Build and run project
5. Open Fiddler/Postman/etc and go to localhost:port/test -> 404
誰能告訴我如何得到這個特別的部分工作?
編輯:
也許應該指出的服務器默認是IIS 8.0快遞
胡說。這是我頭腦中忘了。 – Robert