โโโโโโโโโโโโโโโ โโโโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโ โโโโโโโ โโโ โโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโ โโโ โโโโโโโโโโ โโโ โโโ โโโโโโ โโโโโโ โโโ
โโโโโโโโโโโโโโโ โโโโโโ โโโ โโโโโโโ โโโ โโโ โโโ โโโโโโ โโโโโโ โโโ
โโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโ โโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโ โโโโโโโ โโโโโโโ
๐ WEB FORMS TO MODERN ๐ KILLING VIEWSTATE ONE PAGE AT A TIME ๐
GAME STATUS: ๐ข READY TO PLAY
DIFFICULTY: โญโญโญโญ HARD MODE
BOSS BATTLE: VIEWSTATE MONSTER ๐พ
Welcome to the ultimate modernization arcade! This lab takes you on a neon-soaked journey from the dark ages of ASP.NET Web Forms 4.8 to the bright future of .NET 9. Using the legendary Spec2Cloud methodology, you'll reverse-engineer a legacy municipal permit system and rebuild it with modern tech โ all driven by auto-generated specifications!
๐๏ธ Mission: Modernize "Riverdale City Council" building permit system
๐ Method: SPEC โ CODE methodology
๐ Enemy: ViewState, DataSets, Crystal Reports, UpdatePanels
๐ฏ Victory: Azure-hosted .NET 9 app with Blazor superpowers
- ๐ SPEC GENERATION โ Reverse-engineer legacy codebases into comprehensive specifications
- ๐บ๏ธ BLUEPRINT READY โ Use architecture docs, API contracts, and data models as your modernization guide
- ๐ SPEC โ CODE โ Drive implementation directly from generated specifications
- ๐ DECISION TRACKING โ Document modernization choices in the specs themselves
- ๐ VIEWSTATE ELIMINATED โ Replace 200KB+ ViewState pages with stateless MVC/Blazor
- ๐ฅ UPDATEPANEL DESTROYED โ Swap fake AJAX for real Blazor Server interactivity
- ๐๏ธ DATASET PURGED โ Convert ADO.NET DataSets to strongly-typed EF Core entities
- ๐ CRYSTAL REPORTS REPLACED โ Generate PDFs with QuestPDF instead of Crystal Reports
- ๐ง STORED PROC LOGIC REFACTORED โ Extract business rules into domain services
- โจ ASP.NET Core MVC + Blazor for hybrid rendering
- ๐ Entity Framework Core 9 with repository pattern
- โ๏ธ Azure Services โ App Service, SQL Database, Redis Cache, Blob Storage
- ๐ Entra ID Authentication with role-based access
- ๐ Azure AI Search for permit lookup
- ๐ง Skills: C# and ASP.NET experience
- ๐ Knowledge: Basic Spec2Cloud concepts
- ๐ช Level: Intermediate-Advanced .NET developer
- โ .NET Framework 4.8 Developer Pack (for legacy app)
- โ .NET 9 SDK (for modernized app)
- โ Visual Studio 2022 (your primary weapon)
- โ SQL Server LocalDB (database arena)
- โ Azure Subscription (cloud battleground)
- โ Git (version control shield)
- โ GitHub Copilot CLI (your AI companion)
# Verify .NET installations
dotnet --list-sdks
dotnet --list-runtimes
# Install GitHub Copilot CLI (if not already installed)
gh copilot --version
# Clone the repository
git clone https://github.com/EmeaAppGbb/appmodlab-spec2cloud-dotnet-framework.git
cd appmodlab-spec2cloud-dotnet-framework# Switch to legacy branch
git checkout legacy
# Restore and run the Web Forms app
cd RiverdalePermitSystem
dotnet restore
dotnet run --project RiverdalePermitSystem.Web๐ Navigate to https://localhost:5001 and experience the horror of ViewState! ๐ป
# Use Spec2Cloud to analyze the legacy codebase
gh copilot suggest "Run Spec2Cloud analysis on the RiverdalePermitSystem solution"
# Review generated specifications
git checkout step-1-spec-generation
# Examine: /specs/architecture.md, /specs/api-contracts/, /specs/data-models/๐บ๏ธ BLUEPRINT READY โ Specifications captured! ๐
# Follow the step-by-step branches
git checkout step-3-data-layer # Build EF Core entities from data model specs
git checkout step-4-business-logic # Implement services from business rule specs
git checkout step-5-ui-migration # Build MVC/Blazor from page specsgit checkout step-6-deploy
# Deploy using provided Bicep templates
gh copilot suggest "Deploy the modernized app to Azure using the infrastructure/main.bicep template"๐ VICTORY ACHIEVED โ ViewState monster defeated! ๐
appmodlab-spec2cloud-dotnet-framework/
โโโ ๐ฎ README.md โ YOU ARE HERE
โโโ ๐ APPMODLAB.md โ Full lab walkthrough
โโโ ๐๏ธ RiverdalePermitSystem/ โ Legacy Web Forms app (legacy branch)
โ โโโ RiverdalePermitSystem.sln
โ โโโ RiverdalePermitSystem.Web/
โ โ โโโ Pages/ โ Web Forms pages (.aspx)
โ โ โ โโโ PermitApplication.aspx โ Multi-step wizard with ViewState ๐
โ โ โ โโโ PlanReview.aspx โ Plan review workflow
โ โ โ โโโ InspectionSchedule.aspx โ Inspector scheduling grid
โ โ โ โโโ PermitSearch.aspx โ GridView + ObjectDataSource
โ โ โ โโโ Dashboard.aspx โ UpdatePanels for "AJAX" ๐ฅ
โ โ โโโ UserControls/ โ Reusable .ascx controls
โ โ โโโ Reports/ โ Crystal Reports (.rpt) ๐
โ โ โโโ App_Code/ โ DataSet-based data access ๐๏ธ
โ โโโ Database/ โ Schema + 40+ stored procedures
โโโ ๐ RiverdalePermitSystem.Modern/ โ .NET 9 app (solution branch)
โ โโโ RiverdalePermitSystem.Modern.sln
โ โโโ src/
โ โ โโโ Web/ โ ASP.NET Core MVC + Blazor
โ โ โโโ Core/ โ Domain models and interfaces
โ โ โโโ Infrastructure/ โ EF Core, repositories, services
โ โ โโโ Shared/ โ Blazor components
โ โโโ tests/
โโโ ๐ specs/ โ Spec2Cloud generated specs (step-1)
โ โโโ architecture.md โ System architecture blueprint
โ โโโ api-contracts/ โ API endpoint specifications
โ โโโ data-models/ โ Entity and database specs
โ โโโ business-rules/ โ Business logic documentation
โ โโโ page-flows/ โ UI workflow specifications
โโโ โ๏ธ infrastructure/ โ Azure deployment (step-6)
โโโ main.bicep โ Infrastructure as Code
โโโ parameters.json โ Configuration values
| ๐ ENEMY | ๐ฏ WEAKNESS | ๐ REPLACEMENT |
|---|---|---|
| ViewState (200KB+ pages) | Stateless architecture | Blazor Server state management |
| UpdatePanels (fake AJAX) | Real interactivity | Blazor components with SignalR |
| DataSets (transport objects) | Strong typing | EF Core entities |
| Stored Proc Logic (business rules in DB) | Domain-driven design | Domain services in C# |
| Crystal Reports (hard-coded connections) | Modern PDF generation | QuestPDF |
| Session State (SQL Server storage) | Distributed caching | Azure Redis Cache |
| Code-Behind (mixed concerns) | Separation of concerns | MVC pattern + Blazor |
๐ Permits โ Permit applications and issuance tracking
๐ PlanReviews โ Architectural/engineering review workflows
๐ Inspections โ Scheduled inspections and results
๐ค Applicants โ Property owners and builders
๐๏ธ Contractors โ Licensed contractors database
๐ฐ Fees โ Permit fees and payment tracking
โ ๏ธ Business logic in code-behind event handlers โ No separation of concernsโ ๏ธ 40+ stored procedures with business rules โ Logic trapped in databaseโ ๏ธ DataSets stored in session โ Memory bloat and serialization overheadโ ๏ธ Static helper classes โ Untestable, global stateโ ๏ธ ViewState bloat โ Pages exceed 200KB per requestโ ๏ธ No dependency injection โ Tight coupling everywhereโ ๏ธ Minimal test coverage โ Changes are risky
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ FRONTEND โ
โ โโโ ASP.NET Core MVC (static content) โ
โ โโโ Blazor Server (interactive permit wizard, dashboards) โ
โ โโโ Razor Components (reusable UI elements) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ ๐ง BUSINESS LAYER โ
โ โโโ Domain Services (permit validation, fee calculation) โ
โ โโโ Repository Pattern (data access abstraction) โ
โ โโโ Specification Pattern (complex queries) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ ๐พ DATA LAYER โ
โ โโโ Entity Framework Core 9 (ORM) โ
โ โโโ Strongly-typed entities (no DataSets!) โ
โ โโโ Database migrations (code-first approach) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ๏ธ AZURE SERVICES โ
โ โโโ App Service (hosting) โ
โ โโโ Azure SQL Database (data persistence) โ
โ โโโ Azure Redis Cache (distributed caching) โ
โ โโโ Azure Blob Storage (inspection photos) โ
โ โโโ Azure Communication Services (email notifications) โ
โ โโโ Azure AI Search (permit search) โ
โ โโโ Entra ID (authentication & authorization) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
โ Legacy Codebase โ โโโโ โ Spec2Cloud โ โโโโ โ Specifications โ
โ (Web Forms 4.8) โ โ Analysis Tool โ โ (Markdown Docs) โ
โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
โ
โ
โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
โ Deployed App โ โโโโ โ .NET 9 Build โ โโโโ โ Implementation โ
โ (Azure) โ โ (MVC + Blazor) โ โ (Spec-driven) โ
โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
๐ SPEC GENERATED โ ๐บ๏ธ BLUEPRINT READY โ ๐ SPEC โ CODE โ ๐ VIEWSTATE ELIMINATED โ ๐ VICTORY
# Switch to legacy branch and explore the Web Forms horror
git checkout legacy
gh copilot explain "What are the main anti-patterns in this ASP.NET Web Forms application?"
gh copilot suggest "Run the RiverdalePermitSystem locally and test the permit submission workflow"๐ฏ Objectives:
- โ Run the legacy Web Forms app
- โ Submit a test permit application
- โ Schedule an inspection
- โ Generate a Crystal Report
- โ Observe ViewState size (check dev tools network tab!)
# Generate specifications using Spec2Cloud
git checkout step-1-spec-generation
gh copilot suggest "Analyze the Web Forms codebase with Spec2Cloud and generate architecture specifications"
# Review generated specs
gh copilot explain "Explain the generated architecture.md specification"๐ฏ Objectives:
- โ Run Spec2Cloud analysis on legacy codebase
- โ Review architecture specifications
- โ Examine API contract definitions
- โ Study data model specifications
- โ Document business rules found in stored procedures
๐ SPEC GENERATED โ You are here!
git checkout step-2-spec-review
# Review refined specifications with modernization decisions annotated๐ฏ Objectives:
- โ Review each specification for completeness
- โ Identify modernization patterns (DataSet โ Entity, etc.)
- โ Document technology choices in specs
- โ Map Web Forms pages to MVC/Blazor equivalents
๐บ๏ธ BLUEPRINT READY โ You are here!
git checkout step-3-data-layer
gh copilot suggest "Create EF Core entities based on the data model specifications"
# Use Copilot to generate entities from specs
gh copilot chat "Create the Permit entity class based on specs/data-models/permit.md"
gh copilot chat "Create the DbContext with all entities and relationships"๐ฏ Objectives:
- โ Create EF Core entities matching data model specs
- โ Configure DbContext with relationships
- โ Implement repository interfaces
- โ Create database migrations
- โ Seed test data
๐๏ธ DATASET PURGED โ Boss defeated!
git checkout step-4-business-logic
gh copilot suggest "Implement domain services based on business rule specifications"
# Extract logic from stored procedures using specs
gh copilot chat "Convert the usp_ValidatePermitApplication stored procedure to a C# domain service using specs/business-rules/permit-validation.md"๐ฏ Objectives:
- โ Create domain service interfaces
- โ Implement permit validation service
- โ Implement fee calculation service
- โ Implement inspection scheduling service
- โ Add unit tests for business logic
๐ง STORED PROC LOGIC REFACTORED โ Boss defeated!
git checkout step-5-ui-migration
gh copilot suggest "Create MVC controllers and Blazor components based on page specifications"
# Convert Web Forms pages using specs
gh copilot chat "Convert PermitApplication.aspx to an MVC controller and Blazor wizard component using specs/page-flows/permit-application.md"๐ฏ Objectives:
- โ Create MVC controllers and views
- โ Build Blazor components for interactive elements
- โ Implement permit submission wizard (Blazor)
- โ Implement inspection scheduling grid (Blazor)
- โ Build admin dashboard with real-time updates
- โ Replace Crystal Reports with QuestPDF
๐ VIEWSTATE ELIMINATED โ Final boss defeated!
๐ฅ UPDATEPANEL DESTROYED โ Final boss defeated!
๐ CRYSTAL REPORTS REPLACED โ Final boss defeated!
git checkout step-6-deploy
gh copilot suggest "Deploy the application to Azure using the Bicep templates in infrastructure/"
# Deploy infrastructure
az deployment group create --resource-group rg-riverdale-permits \
--template-file infrastructure/main.bicep \
--parameters infrastructure/parameters.json
# Deploy application
gh copilot suggest "Publish the .NET 9 application to Azure App Service"๐ฏ Objectives:
- โ Provision Azure resources (App Service, SQL, Redis, Blob, etc.)
- โ Configure Entra ID authentication
- โ Deploy application code
- โ Run database migrations in Azure SQL
- โ Configure Azure Communication Services for emails
- โ Test all workflows in production
๐ VICTORY ACHIEVED โ Game complete! ๐
๐ฎ TOTAL PLAYTIME: 6โ8 hours
โณ STAGE BREAKDOWN:
- ๐น๏ธ Stage 1: Exploration โ 30 min
- ๐น๏ธ Stage 2: Spec Generation โ 1 hour
- ๐น๏ธ Stage 3: Spec Review โ 1 hour
- ๐น๏ธ Stage 4: Data Layer โ 1.5 hours
- ๐น๏ธ Stage 5: Business Layer โ 1.5 hours
- ๐น๏ธ Stage 6: UI Layer โ 2 hours
- ๐น๏ธ Stage 7: Azure Deployment โ 1 hour
๐ก PRO TIP: Use GitHub Copilot CLI throughout for maximum efficiency! The gh copilot suggest and gh copilot chat commands are your power-ups! ๐
- ๐ Spec2Cloud Documentation
- ๐ ASP.NET Core Migration Guide
- ๐ Blazor Server Documentation
- ๐ Entity Framework Core 9
- ๐ QuestPDF Documentation
- ๐ง GitHub Copilot CLI
- ๐ง .NET 9 SDK
- ๐ง Visual Studio 2022
- ๐ง Azure CLI
- โ๏ธ Azure App Service
- โ๏ธ Azure SQL Database
- โ๏ธ Azure Redis Cache
- โ๏ธ Azure Blob Storage
- โ๏ธ Azure Communication Services
- โ๏ธ Azure AI Search
- โ๏ธ Microsoft Entra ID
- ๐น๏ธ Spec2Cloud Java Spring Boot Modernization
- ๐น๏ธ Spec2Cloud Node.js Modernization
- ๐น๏ธ Azure Migration Assessment Lab
Complete the lab to earn these badges:
- ๐ฅ ViewState Slayer โ Eliminated 200KB+ ViewState pages
- ๐ฅ UpdatePanel Destroyer โ Replaced fake AJAX with Blazor
- ๐ฅ DataSet Purger โ Migrated all DataSets to EF Core entities
- ๐ฅ Crystal Crusher โ Replaced Crystal Reports with QuestPDF
- ๐ฅ Spec Master โ Generated and used specifications throughout modernization
- ๐ฅ Azure Champion โ Successfully deployed to Azure
- ๐ฅ Migration Architect โ Completed full modernization workflow
- ๐ฅ .NET Legend โ Mastered both .NET Framework and .NET 9
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โ โโโ โโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโ โโโโโโโ โโโ โโโ โ
โ โโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโ โ
โ โโโ โโโโโโโโโ โโโ โโโ โโโโโโโโโโโ โโโโโโโ โ
โ โโโโ โโโโโโโโโโ โโโ โโโ โโโโโโโโโโโ โโโโโ โ
โ โโโโโโโ โโโโโโโโโโโ โโโ โโโโโโโโโโโโ โโโ โโโ โ
โ โโโโโ โโโ โโโโโโโ โโโ โโโโโโโ โโโ โโโ โโโ โ
โ โ
โ ๐ CONGRATULATIONS, SPEC WARRIOR! ๐ โ
โ โ
โ You've defeated the ViewState monster and modernized a legacy โ
โ .NET Framework application using the Spec2Cloud methodology! โ
โ โ
โ ๐ SPEC GENERATED โ ๐บ๏ธ BLUEPRINT READY โ โ
โ ๐ SPEC โ CODE โ ๐ VIEWSTATE ELIMINATED โ
โ โ
โ โญ HIGH SCORE: LEGACY APP MODERNIZED โญ โ
โ โ
โ Press START to play again โ
โ (Try another modernization lab!) โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ฎ Ready Player One? Let's modernize some legacy code! ๐
๐ SPEC GENERATED | ๐บ๏ธ BLUEPRINT READY | ๐ SPEC โ CODE | ๐ VIEWSTATE ELIMINATED
Built with โค๏ธ by the GBB App Modernization Team
Powered by GitHub Copilot CLI ๐ค and Spec2Cloud ๐