Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2013: Creating a new ASP.Net project WITHOUT nuget

First, I want to say that I love nuget in general and use it a LOT for many small projects, and especially when trying out new things.

However, I have a number of reasons why I feel Nuget is not appropriate for my primary project / environment:

  • The code gets deployed to a secure environment - because of this a high level of oversight is required
  • It is a fairly large project with ~10 developers spanning several years - the time saved by quickly adding packages is negligible.
  • I have no interest in libraries automatically updating
  • I want to know what configurations are being made when adopting a new library, and what other options I have besides whatever "reasonable default" has been determined on my behalf.

Simply put, I want to know what's going into my project and Nuget is far too aggressive in "helping me out" than I can stomach.

So I was really disappointed when I created a new "empty" asp.net project with support for MVC and WebAPI and found myself with 8 nuget packages configured. Much of these files are wasteful (I really do not need JSON.Net for every version of the .Net framework ever, but thanks).

To get a similar setup without nuget I did the following:

  1. Stashed a copy of the web.config
  2. Copied all of the DLLs i was interested into a new folder
  3. Uninstalled all nuget packages
  4. Referenced the DLLs I wanted
  5. Re-added the neccessary web.config bits

Ahh, there we go. Much better.

I then went ahead and right clicked the Controllers folder > Add Controller and Right click the views folder and > Add View.

Inexplicably, the nuget packages file was back and had "helped me" by adding

  • jquery
  • jquery validation
  • jquery unobtrusive validation.

Who said I wanted to use jquery validation?!

So my question is: How do I stop the madness? Am I doomed to tiptoeing around VS tooling if I don't want to use nuget?

Alternatively, I would also accept a convincing argument explaining that I am being unnecessarily anal-retentive about what goes into my project and should just drink the Kool-Aid.

like image 536
Shaun Rowan Avatar asked Nov 06 '13 02:11

Shaun Rowan


People also ask

How do I create an ASPX page in Visual Studio 2013?

Select the Visual C# -> Web templates group on the left. Then, select Web Form from the middle list and name it FirstWebPage. aspx. Click Add to add the web page to your project.

How do I open an ASP NET project in Visual Studio?

Start Visual Studio, on the File menu select New, and then select Project. In the New Project dialog box, select Visual Basic or Visual C# as the programming language. In the Templates pane, select ASP.NET Empty Web Application, and name the project SofiaCarRentalWebApp. Click OK to create the solution and the project.


1 Answers

I don't see a reason why you wouldn't want to use NuGet. These are my thoughts on this:

The code gets deployed to a secure environment - because of this a high level of oversight is required

This has nothing to do with NuGet. If you need a high level of oversight then what you need is a good branching and release strategy with your source control of choice. Code review policies, etc.

It is a fairly large project with ~10 developers spanning several years - the time saved by quickly adding packages is negligible.

NuGet is not about quickly adding dependencies. It is about effectively managing your dependencies. So the question is, will you have any dependencies? If yes then why would you want to refuse to use a tool which helps you to manage them in a way where you are less likely to make mistakes?

I have no interest in libraries automatically updating

NuGet doesn't update your libraries automatically.

However, it shows you all available updates in one location and you can choose which updates you want to accept. This is a great feature and I don't see why this would bother you. To be honest you are more likely to miss highly critical updates if you don't use NuGet. What if Microsoft fixes a critical security issue in one of the MVC libraries?

NuGet will

  • show you the available update
  • help you to apply the update in all places where you have a dependency on the updated library
  • help you to pick the correct version for your target project

I want to know what configurations are being made when adopting a new library, and what other options I have besides whatever "reasonable default" has been determined on my behalf.

This has nothing to do with NuGet. Whether you make use of a 3rd party library via NuGet or manually, in both cases you will have to read the docs of the library to make an educated decision on how you want to configure your project.

The only difference is that by installing a NuGet package it is more likely to be shipped with a sensible configuration out of the box. So really you can only benefit from it. If you want to change your configuration then it doesn't matter which default you change, right?

like image 147
dustinmoris Avatar answered Nov 10 '22 10:11

dustinmoris