access method 'System.Web.Http.HttpConfiguration.DefaultFormatters()' failed

后端 未结 3 617
生来不讨喜
生来不讨喜 2020-12-18 19:02

I have problem with unit testing my WEB API controller, I\'m using moq to mock up my repository, do the setup and response for it. Then initiate the controller with mocked r

3条回答
  •  时光说笑
    2020-12-18 19:31

    Try ensuring that Microsoft.AspNet.WebApi.Client is installed.

    My app wasn't working because I'd removed that for other reasons.

    Open Package Manager Console and execute:

    Install-Package Microsoft.AspNet.WebApi.Client

提交回复
热议问题