简体   繁体   中英

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM