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

WebMatrix and Project Structure

How Microsoft's free WebMatrix tool creates and organizes an ASP.NET Web Pages site, including the special App_Data, App_Start, and Account folders and the built-in development web server.

Web Pages FoundationsBeginner9 min readJul 10, 2026
Analogies

What WebMatrix Provides

WebMatrix is a free, lightweight IDE Microsoft released specifically to make ASP.NET Web Pages accessible to beginners, bundling a code editor, a built-in lightweight web server (IIS Express), a SQL Server Compact database editor, and one-click publishing to a hosting provider all in a single small download. Unlike full Visual Studio, WebMatrix starts up quickly, has a simplified interface with just Files, Databases, and Reports workspaces, and includes a gallery of starter site templates for blogs and small e-commerce sites that you can install with a couple of clicks.

🏏

Cricket analogy: WebMatrix is like a compact backyard cricket set with a plastic bat, stumps, and a tennis ball that lets a kid start playing in minutes, compared to needing a full turf ground, professional kit, and groundstaff before Test cricket can begin.

The Default Folder Layout

text
MySite/
  _AppStart.cshtml        (runs once when the site starts)
  Default.cshtml           (maps to the site root, "/")
  About.cshtml              (maps to "/About")
  Contact.cshtml            (maps to "/Contact")
  App_Data/
    MySite.sdf               (SQL Server Compact database file)
  App_Start/
    (optional bootstrapping code files)
  Account/
    Login.cshtml
    Register.cshtml
  Shared/
    _SiteLayout.cshtml       (shared layout page)
    _Logo.cshtml              (reusable partial)
  Scripts/
    site.js
  Content/
    site.css

A WebMatrix project has no strict requirement for a src folder or project file the way a compiled .NET project does; instead, the folder structure itself is the site, and ASP.NET's runtime resolves requests by matching the URL to a file path. App_Data is a special, protected folder that IIS never serves directly to browsers, making it the conventional home for a SQL Server Compact .sdf database file or any other data files that must never be publicly downloadable. _AppStart.cshtml, if present, runs exactly once when the application first starts, which is the typical place to call WebSecurity.InitializeDatabaseConnection() to wire up the built-in membership system used by the Account folder's login and registration pages.

🏏

Cricket analogy: App_Data acts like the dressing room at a stadium, off-limits to spectators in the stands even though it's physically part of the ground, just as App_Data is part of the site but never served to visiting browsers.

IIS and ASP.NET are configured by default to block direct HTTP access to files inside App_Data, App_Start, and Bin folders, which is why database files and configuration assemblies belong there rather than in a publicly reachable folder.

Running the Site with IIS Express

When you click Run in WebMatrix, it launches IIS Express, a lightweight, self-contained version of IIS that doesn't require administrator installation on the whole machine, and opens the default browser pointed at a localhost address with a dynamically assigned port such as http://localhost:12345. This gives you an accurate preview of how the site will behave under a real IIS-compatible server, including things like the App_Data protection rules and the ASP.NET request pipeline, which is more representative than a generic static file server would be.

🏏

Cricket analogy: IIS Express is like a practice net with proper turf pitch behavior set up on the side of the main ground, giving a batter a realistic feel for match conditions without booking the full stadium.

IIS Express is a development-time server bound to localhost. It is not intended for production hosting; when you deploy a WebMatrix site, you publish it to a real IIS server or a hosting provider that supports ASP.NET.

  • WebMatrix is a free, lightweight IDE bundling an editor, IIS Express, a database tool, and one-click publishing.
  • A Web Pages project's folder structure directly determines its site's URL structure; there's no separate project file.
  • App_Data is a protected folder that IIS never serves directly, ideal for SQL Server Compact .sdf database files.
  • _AppStart.cshtml runs once at application startup, typically used to initialize the WebSecurity membership system.
  • The Account folder conventionally holds Login.cshtml and Register.cshtml for the built-in membership provider.
  • IIS Express is a self-contained development server that previews the site under realistic ASP.NET conditions.
  • IIS Express is for local development only and is not meant for production hosting.

Practice what you learned

Was this page helpful?

Topics covered

#NETFramework#ClassicASPNETWebFormsWebPagesStudyNotes#MicrosoftTechnologies#WebMatrixAndProjectStructure#WebMatrix#Project#Structure#Provides#StudyNotes#SkillVeris