+1  A: 

I create a new project using the new project wizard so that I get unique project GUIDs assigned. Then I would use "Add Existing Item" to copy items from similar projects if it made sense to do so.

I sometimes use a file diff tool to copy references from one project to another, otherwise I just add the references by hand. A file diff tool can also be used to include similar source files, but the underlying files have to be copied anyway, so I prefer "Add Existing Item".

I've used T4 to generate solution and project files, but that definitely seems like an edge case and not something that would normally be necessary. In that case, I'd probably wrap the T4 in a PowerShell like script to create and populate the rest of the directory structure.

I use "shared libraries" pretty aggressively in general, but not specifically due to this scenario.

In general, I don't find myself reusing plumbing between projects much. It's probably more often that I hack away in one "prototype" project, then abandon it, and rebuild the project from scratch following the above approach and only bring over the "non-hacky" code.

Michael Maddox
+3  A: 

Sosh,

I definately (mostly!!) go for T4 templates in conjunction with a modified version of subsonic 3. i kinda use the database to model my domain and then use the T4 templates to generate the model and associated controllers and views. takes about 50-60% of the effort out and keeps a consistancy in place. I then work on overrides (partials) of the classes along with filters and extension methods to 'make the app'. now that i'm familiar with the environment and what I'm doing, I can have a basic model with good plumbing in place in a very short space of time. more importantly, becuse i create a set of partial class files, i can regenerate all i want without losing any of my 'custom' coding.

works for me anyway :)

jim

jimi
+5  A: 

Visual Studio supports Custom Templates.

Baddie
+1  A: 

I'm creating a MVC2 application template at http://erictopia.com. It will contain all the basic items I think should be in a MVC project. These include BDD specifications, an ORM (NHibernate and possibly Lightspeed), T4 templates, custom providers, ELMAH support, CSS/Javascript minifier, etc.

37Stars
Thanks, I'll follow your posts - Good luck!
UpTheCreek
+2  A: 

You could do it the bearded, t-shirted, agile style and create a nice template and put it in sourcecontrol. So when you need a new project, you just checkout the template?

Christian W
That sounds good, but what about project name, namespaces etc?
UpTheCreek
Hmm... Got me :D Global rename?
Christian W
Yeah I suppose, but I just seems so messy! I feels like there must be a 'right' way to go about this that I don't know about.
UpTheCreek
Can anyone comment on any gotchas with global renaming like this?
UpTheCreek
+2  A: 

For insanely fast MVC site setup, I use modified T4 templates (created with T4 Editor) and with ALOT of help from Oleg Sych's blogs for page generation (for your typical add/edit/index pages) combined with an awesome implementation of an automated create-update-delete called MVCCrud (if LINQ-to-SQL is your preferred data access method)

Using modified T4 templates and MVCCrud you can create fully functional entities (Create/Edit/List/Delete) with error handling and intuitive error messages in about 4 minutes for each.

Jimbo
I should mention that your sites will look amazing (and functional) with MVCCrud's new jqGrid support :) bonus...
Jimbo
MVCCrud looks interesting - but is it really Linq-2-SQL only? That would be a showstopper for me.
UpTheCreek
@Sosh no its not Linq-2-SQL only, but there is only a linq-2-sql repository at the moment, you can either make your own repository that implements IMvcCrudRepository or map your delegates manually in your controller (ive never tried anything but Linq-2-SQL with it but its designed to be used by other things as well)
Matthew Hood