ASP.Net MVC Walkthrough – Gears of Web

There so many great resources for learning ASP.Net MVC out there, especially on Scott Guthrie’s blog. I found that the approach taken by most bloggers in their tutorials involves writing a project, while it is a great way to get the some hands-on experience, it can be overwhelming to first understand the context of the project and then how the MVC framework handles the project.

In this walkthrough series, I will go through the beautiful ASP.Net MVC framework and attempt to explain its many cogs that interact to build powerful web applications. I won’t be going in to any projects that involve restaurants or nerds.

First let’s get the gears of war err… web.

Visual Studio 2010

You might have heard of it, it’s this amazing IDE we .Net-ers use. VS2010, like its predecessors comes in many editions. The VS2010 Express Edition is free and pretty sweet. Also, if you’re a student, don’t read any further and head over to DreamSpark and get yourself a fresh VS2010 Professional Edition. Yeah, pretty sweeter!

Web Platform Installer

This is something you might not have heard of. Using Web Platform Installer Microsoft distributes all its web components to us developers. It’s got everything. Get it. Now.


I have nothing else to say to you if you have not installed Nuget. It’s the one tool that every .Net developer needs besides Visual Studio. With it, you’ll be able to download from a plethora of community powered tools and projects that will make life and working with MVC a breeze.

Everything else

From here on, installing ASP.Net MVC 3 and updates for Visual Studio should be an easy exploration. Hint: Web PI. In my next post, I’ll write about all the basics and background to MVC. Stay tuned!

This post also appeared on the Go DevMENTAL blog.


MVC3 Docking on AppHarbor and Entity Framework Code First

So, I spent last few hours figuring this out. AppHarbor is pretty nice. AppHarbor is free for one application, one database and it does work with SQL Server CE. I just deployed a stripped down version of one of my MVC projects there and it’s pretty smooth. So, here’s a run down of how it’s done, so that someone else might not need hours.

Stripping the project down was a breeze, you’ve got to love Object Oriented design, it’s beautiful. Deploying the project was a no-brainer too, if you’ve had some experience with Git. But testing, as ever brought out the issues.

I was using Entity Framework Code First (EFCF) as my ORM and it likes to drop databases. I didn’t realize it since it’s natural for EFCF to. And for good reason too, for when you change your models. On AppHarbor, you don’t get permissions to create databases. Thus the problem.

But no fear, NuGet to the rescue. Again. Actually, community to the rescue. There’s a workaround for EFCF’s DropCreateDatabases it’s DontDropDbJustCreateTables. You can find here on NuGet. It plugs in beautifully to your application and all you need to do is enter your context name. Also, you will have to get a new database from AppHarbor since already EFCF dropped it.

Also the connection string should include a providerName otherwise, exceptions!

    <add name="connection string name"
         connectionString=";Database=dbXXXX;User ID=dbXXXX;Password=YourPassword;"
         providerName="System.Data.SqlClient" />