Search code examples
.netasp.net-mvcvisual-studioproject-layout

Project Layout and Site Structure in ASP.NET MVC


I'm new to ASP.NET MVC and would like to create and deploy a website using ASP.NET MVC.

I have a few old sites that run classic ASP and the site-structure goes like this:

  • web.root (holds website pages)
  • data.files (holds databases)
  • log.files (log files)

I was wondering if the same structure is used for ASP.NET MVC??

What’s the best practice for storing your Visual Studio project files?


Solution

  • ASP.NET MVC uses its own structure. There are excellent books on how ASP.NET MVC works, including Professional ASP.NET MVC 1.0 by Wrox. Understanding why ASP.NET MVC differs from ASP.NET and why it does what it does is crucial to utilizing it correctly.

    MVC uses its own file structure, as I alluded to before:

    Image File Structure

    This file structure is 'by default' or as MVC-types call it, "Convention over configuration". If you install Visual Studio 2008, and start a new ASP.NET MVC 1.0 project, you'll find that this structure has been created for you.

    With regards to deployment, there are plenty of Stack Overflow questions that deal with that.