NuGet package for ASP.NET MVC 3

17,096

Solution 1

If you're using Visual Studio 2010 SP1, you can right click on the project and select "Add Deployable Assemblies". Select the ASP.NET MVC 3 option. That'll add the MVC assemblies to a special directory which will ensure they are in the bin directory when building/publishing your web application.

Solution 2

Looks like the "aspnetmvc" NuGet package is what you're looking for.

http://nuget.org/List/Packages/aspnetmvc

N.B. This isn't an official package from Microsoft, but one created by a member of the community.

Solution 3

If you're coming across this question now, the other solutions will likely no longer work for VS2012, VS2013, and beyond. Instead, I found adding the correct NuGet package worked seamlessly:

In Tools > NuGet Package Manager > Package Manager Console:

PM> Install-Package Microsoft.AspNet.Mvc -Version 3.0.50813.1 

This package is owned by Microsoft, and trustworthy.

Solution 4

Just a note for upgrading to MVC4

If you are still using bin deployables (“Add Deployable Assembly”) for your current ASP.NET MVC setup .. you should remove it and replace it with the AspNetMvc nuget package.

Share:
17,096

Related videos on Youtube

nabeelfarid
Author by

nabeelfarid

Updated on June 04, 2022

Comments

  • nabeelfarid
    nabeelfarid almost 2 years

    I have recently started to use NuGet and I was wondering if there is an asp.net mvc 3 package that I can install so that I do not have to reference the aspnet mvc3 assemblies via a lib folder like the traditional way with all references set to CopyLocal = true. At the moment I have the following assemblies in my lib folder:

    Microsoft.Web.Infrastructure.dll
    System.Web.Helpers.dll
    System.Web.Mvc.dll
    System.Web.Razor.dll
    System.Web.WebPages.Administration.dll
    System.Web.WebPages.Deployment.dll
    System.Web.WebPages.dll
    System.Web.WebPages.Razor.dll
    

    Any idea?

  • nabeelfarid
    nabeelfarid almost 13 years
    oh thats a new one Phil..didn't know that ... cheers ... but I still wonder why do we have to go down this new route, why not simply have an nuget package and put these assemblies in the packages folder
  • edoloughlin
    edoloughlin almost 13 years
    We're looking into that option. We ran into some...non-technical difficulties while investigating that.
  • deerchao
    deerchao over 12 years
    It does not work with Class Library projects. Seems NuGet is still the best choice if available.
  • devuxer
    devuxer over 12 years
    Wait...*Non*-technical difficulties?
  • Chris Marisic
    Chris Marisic over 11 years
    @DanM aka issues from "the man" but clearly those hurdles were resolved.
  • devuxer
    devuxer over 11 years
    @ChrisMarisic, ahh thanks for clarifying :) And thanks for bringing my attention back to this thread...sounds like we no longer need to add deployable assemblies.
  • Chris Marisic
    Chris Marisic over 11 years
    @DanM that was the reason i ended up on this thread, i was confused at who moved my cheese in VS2012 when i went to add those deployable dependencies