Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you put an ASP.Net MVC 4 application in source control?

So, I created a brand new ASP.Net MVC 4 application from Visual Studio. Much to my surprise, an "empty" project weighed in at 54Mb after pulling in and compiling all the packages. Obviously, I don't want to stick unnecessary things in source control, especially binaries.

I figured that the packages.config file would control packages so that it would redownload them when missing and I could delete the packages directory, but that didn't work. After deleting packages, I get errors like : "BundleCollection could not be found". I checked in the references of the project and there seems to be no problems resolving any of them. Where does this come from? I'm also missing apparently common namespaces like System.Web.Optimization. I have a reference to it in my project and Visual Studio reports the reference is "resolved", but it points to the (deleted) package directory, which I assume is why it's erroring out.

What is the idiomatic method of putting an ASP.Net MVC 4 application in source control, especially with management of NuGet packages?

like image 605
Earlz Avatar asked Oct 04 '22 14:10

Earlz


1 Answers

This is a great article on using NuGet without adding the packages to source control. The article is for VS 2010, but I am doing the same thing in VS 2012

Using NuGet without adding packages to source control

like image 118
Maess Avatar answered Oct 07 '22 22:10

Maess