100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
.NET Framework

Installing and Setting Up MVC

A practical walkthrough of setting up your development environment and creating your first ASP.NET MVC project using Visual Studio and the .NET tooling.

FoundationsBeginner8 min readJul 10, 2026
Analogies

Installing and Setting Up MVC

Building ASP.NET MVC applications requires Visual Studio (Community edition is free) with the 'ASP.NET and web development' workload installed, or, for the modern ASP.NET Core MVC flavor, the .NET SDK plus any editor (Visual Studio, VS Code with the C# extension, or Rider). Classic ASP.NET MVC targets .NET Framework and runs on Windows/IIS, while ASP.NET Core MVC is cross-platform and runs on Windows, macOS, and Linux via Kestrel.

🏏

Cricket analogy: Choosing classic MVC (Windows-only) versus ASP.NET Core (cross-platform) is like choosing between a domestic-only cricket league that only plays on home turf versus an international circuit that tours grounds worldwide.

Creating a New Project

In Visual Studio, File > New Project > ASP.NET Web Application (.NET Framework) lets you pick the 'MVC' template, which scaffolds the full folder structure (Controllers, Views, Models, App_Start) along with NuGet references to Microsoft.AspNet.Mvc, System.Web.Mvc, and Entity Framework. For ASP.NET Core MVC, the equivalent is running dotnet new mvc -n MyApp from the CLI, which generates a leaner Program.cs-based startup instead of Global.asax.

🏏

Cricket analogy: dotnet new mvc -n MyStoreApp scaffolding a full project structure is like a franchise league instantly setting up a new team's kit, ground, and roster template the moment it's registered.

Configuring NuGet Packages and Dependencies

Classic MVC projects rely on NuGet for core dependencies like Microsoft.AspNet.Mvc, Microsoft.AspNet.Razor, and EntityFramework, all restorable via right-click 'Manage NuGet Packages' or the Package Manager Console command Update-Package -reinstall. ASP.NET Core MVC instead lists its dependencies as PackageReference entries in the .csproj file, and running dotnet restore pulls everything needed before the first build.

🏏

Cricket analogy: NuGet restoring Microsoft.AspNet.Mvc dependencies is like a cricket board ensuring every required piece of equipment (bats, pads, helmets) is delivered to a new team before their first match.

bash
dotnet new mvc -n MyStoreApp
cd MyStoreApp
dotnet restore
dotnet run

Running and Debugging the Application

Pressing F5 in Visual Studio launches IIS Express, compiles the project, opens a browser at a localhost port (e.g., https://localhost:44300), and attaches the debugger so breakpoints in controller actions or Razor views work immediately. For ASP.NET Core, dotnet run starts the Kestrel web server directly, and launchSettings.json under /Properties controls which profile (IIS Express, project, or a specific URL/port) is used when debugging.

🏏

Cricket analogy: Setting breakpoints in a controller action during F5 debugging is like a coach pausing match footage frame-by-frame at a specific delivery to analyze exactly what happened.

If a fresh project fails to build immediately after scaffolding, the most common cause is a missing or mismatched NuGet package restore - right-click the solution and choose 'Restore NuGet Packages,' or run dotnet restore from the project directory.

Classic ASP.NET MVC (targeting .NET Framework) only runs on Windows via IIS or IIS Express. If you need cross-platform support (Linux/macOS deployment, Docker), you must use ASP.NET Core MVC instead, which is a different (though conceptually similar) framework.

  • Classic ASP.NET MVC needs Visual Studio with the 'ASP.NET and web development' workload, and runs only on Windows/IIS.
  • ASP.NET Core MVC is cross-platform, using the .NET SDK and Kestrel, installable on any OS.
  • File > New Project > MVC scaffolds Controllers/Views/Models automatically in Visual Studio.
  • dotnet new mvc -n MyApp is the CLI equivalent for ASP.NET Core projects.
  • Classic MVC dependencies come via NuGet; ASP.NET Core lists them as PackageReference in .csproj.
  • F5 in Visual Studio launches IIS Express with an attached debugger.
  • dotnet run starts Kestrel directly for ASP.NET Core projects, configured via launchSettings.json.

Practice what you learned

Was this page helpful?

Topics covered

#NETFramework#ASPNETMVCStudyNotes#MicrosoftTechnologies#InstallingAndSettingUpMVC#Installing#Setting#MVC#Creating#StudyNotes#SkillVeris