7

In the MVC4 templates, many many (...many!) assemblies are added to a project, even for the "empty" template.

Which ones are really necessary, and what does each one actually do - I cannot find a list anywhere? I only want to reference the ones I need.

I created an "empty" project and started removing them one by one, but it gets tedious (and breaks) very quickly because of the associated web.config changes, etc.

Bobby B
  • 2,287
  • 2
  • 24
  • 47
  • And I know that nuget is now used to handle all that, but I prefer to take command of this sort of thing, we run a very large system and I need to know which assemblies are required, the versions, dependencies, etc. – Bobby B Oct 01 '12 at 10:43
  • [Here is an example](http://stackoverflow.com/a/11322743/1711500) of all the DLLs needed for Web API- I'm looking for something similar for MVC4, preferably an official/MSDN link if possible (cannot find anything of the kind though). – Bobby B Oct 01 '12 at 10:51

2 Answers2

1

Can't find anything official, but did manage to get a barebones project to run by using this answer.

Would still like to know what all the DLLs are for in the various templates.

Community
  • 1
  • 1
Bobby B
  • 2,287
  • 2
  • 24
  • 47
0

If you are using ReSharper you can right-click the References folder and select either "Remove Unused References" or the safer option "Optimize References". The latter option gives you a report of which assemblies are and aren't used.

Be careful then using this in a mature solution where dependencies are injected as you might not have any direct code references to an assembly at compile time. But they could be required at runtime.

Sorry, I haven't answered your question directly, but hopefully I have shown you how to find out for yourself.

Daniel Dyson
  • 13,192
  • 6
  • 42
  • 73
  • Thanks for the tip, but I don't use Resharper. That would be a nice feature to have in VS though. – Bobby B Oct 01 '12 at 10:58
  • Well, I don't have MVC 4 installed at work, but I'll do it at home this evening if someone else hasn't already answered your question by then. – Daniel Dyson Oct 01 '12 at 11:02
  • [I found a free plugin/vsix](http://visualstudiogallery.msdn.microsoft.com/ff717422-f6a7-4f18-b972-f7540eaf371e) which seems to perform the same thing. But it doesn't clean the `web.config` properly and that breaks the project (Resharper probably does the same thing). So I suppose I'm looking for an "official" deployment guide of some kind. – Bobby B Oct 01 '12 at 11:06