Since a new MVC 4 Internet project has no less that 47 references and 29 nuget packages. I'm wondering what the least number of references I can get away with. I'd like to choose my Javascript and ORM solutions. I basically just want the barebones MVC Framework. What can I get rid of ? And for bonus points what is the minimum I have to add to get WebApi working ?
ASP.NET MVC 4 is a framework for building scalable, standards-based web applications using well-established design patterns and the power of the ASP.NET and the . NET framework. This new, fourth version of the framework focuses on making mobile web application development easier.
Add the "[Required]" attribute to the field that you want to make mandatory for insertion. The Required attribute requires the "System. ComponentModel. DataAnnotations" namespace.
Just for the sake of completeness, here are the minimum references I found to be needed for a working ASP MVC application deployed to IIS (in my case version 7.5). That is to say, if you have these references only, your MVC application will run, and if you don't have all of them, it won't run. Also, keep in mind I'm speaking from a deployment perspective, not a local development web server perspective. Running locally without all these references may work but end up failing when deployed to IIS.
Minimum References
REFERENCE COPY LOCAL*
--------- -----------
Microsoft.Web.Infrastructure true
System false
System.Web false
System.Web.Http false
System.Web.Mvc true
System.Web.WebPages true
System.Web.WebPages.Deployment true
System.Web.WebPages.Razor true
*Copy Local is set to false for these references when they're added to your solution. Set the Copy Local property for the references above accordingly to make sure the DLLs are put into the bin directory when building the project. That way, they will be picked up for deployment.
So its been a while, On update 2 there seems to be a empty template which still has a load of unused references, Once you have created the solution you can safely remove the following references:
and from a Nuget point of view you can remove all of the packages except (and their dependencies) :
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With