Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.0' or one of its dependencies

后端 未结 7 1155
名媛妹妹
名媛妹妹 2021-02-18 13:56

I am adding Ninject in MVC project using the following commands in Package Manager Console:

Install-Package Ninject -version 3.0.1.10
Install-Package Ninject.Web         


        
7条回答
  •  半阙折子戏
    2021-02-18 14:29

    I have a Microsoft ASP.NET Web API 2.2 project which use Ninject.

    To fix the problem, I have to install NuGet Package Microsoft ASP.NET MVC 4 for my project because Ninject requires System.Web.Mvc. By doing so, Visual Studio will add System.Web.Mvc to project's reference.

    Also, you should set Copy Local = True for the property of System.Web.Mvc reference, so the DLL will be copied to Bin folder. The DLL does not come with standard .NET Framework. It is part of the ASP.NET MVC Package.

提交回复
热议问题