【发布时间】:2016-05-09 21:53:50
【问题描述】:
我创建了一个基于 ASP.NET Web API 的应用程序并遵循以下教程:
http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/action-results.
我正在尝试将固有的ApiController 类作为教程中的描述并实现IHttpActionResult 接口,但编译器抱怨说找不到它们的程序集。
我的问题,如何为ApiController 和IHttpActionResult 添加程序集?
更新 1
【问题讨论】:
-
错误说明了什么?是否存在任何依赖错误?您可能想要使用特定版本的 WebApi.Core。我使用 5.2.3 版本,因为它与许多其他依赖项一起使用。
-
尝试在你的启动文件中添加
public void ConfigureServices(IServiceCollection services) services.AddMvc();