Missing reference to System.Web.Mvc in Asp.net Unit Test?

前端 未结 2 1210
隐瞒了意图╮
隐瞒了意图╮ 2021-02-18 23:09

I recently made some unit tests for my Asp.NET MVC application, or I tried to, it keep telling me \"The type \'System.Web.Mvc.Controller\' is defined in an assembly that is not

2条回答
  •  Happy的楠姐
    2021-02-18 23:15

    MVC 5 comes in from a NuGet package. Just as it did with the main MVC web project in your solution. Install MVC via NuGet into your Test project, and you should be good to go.

提交回复
热议问题