Skip to content

Conversation

@devin-ai-integration
Copy link

Migrate ASP.NET MVC 5 application from .NET Framework 4.8 to .NET 8

Summary

This PR implements a complete migration of the ASP.NET MVC 5 application from .NET Framework 4.8 to .NET 8, representing a major architectural upgrade from legacy .NET Framework to modern .NET. The migration preserves the existing AngularJS frontend while modernizing the entire backend hosting model, configuration system, and project structure.

Key Changes:

  • Project Format: Converted from legacy MSBuild format to SDK-style project targeting .NET 8.0
  • Hosting Model: Replaced IIS/System.Web hosting with Kestrel/ASP.NET Core minimal hosting
  • Configuration: Migrated from Web.config to appsettings.json and Program.cs
  • Controllers: Updated to use Microsoft.AspNetCore.Mvc instead of System.Web.Mvc
  • Static Files: Implemented custom static file serving for WebApp, Content, and node_modules directories
  • Bundling: Simplified from System.Web.Optimization to direct script/CSS references
  • Cleanup: Removed all legacy .NET Framework files (Global.asax, Web.config, packages.config, App_Start)

The AngularJS frontend (components, directives, and dependencies) remains unchanged and functional.

Review & Testing Checklist for Human

🔴 High Priority (4 items)

  • End-to-End Functionality: Run dotnet run --urls="http://localhost:5002" and verify at http://localhost:5002 that:

    • Page loads with "XLTS for AngularJS with .NET 8" title
    • AngularJS test component displays correct version (1.8.3)
    • Test directive displays jQuery version (3.7.0)
    • All static assets (CSS, JS) load without 404 errors
  • Static File Serving: Verify all asset paths work correctly:

    • /WebApp/ files (AngularJS components/directives)
    • /Content/ files (CSS)
    • /node_modules/ files (jQuery, AngularJS libraries)
  • Build & Deployment: Test the application builds and runs in different environments:

    • Clean build: dotnet clean && dotnet build
    • Production configuration: dotnet run --environment=Production
    • Verify no missing dependencies or configuration issues
  • Performance Impact: Compare page load performance vs original bundled approach:

    • Check browser network tab for number of HTTP requests
    • Verify caching headers are appropriate for static files
    • Consider if the direct reference approach is acceptable for production

Notes

Deviation from Plan: The original migration plan specified .NET 7 and WebOptimizer bundling, but the implementation uses .NET 8 with direct script references. This simplifies the bundling but may impact performance due to multiple HTTP requests instead of bundled assets.

Testing Completed: Basic functionality verified in development environment showing AngularJS components rendering correctly with .NET 8 backend.


Session Info: Requested by Jia Wu ([email protected])
Link to Devin run: https://app.devin.ai/sessions/cde3bc8efc754be38e20c47f271b7ebd

Application Screenshot

devin-ai-integration bot and others added 8 commits September 24, 2025 15:50
- Convert legacy project file to SDK-style format targeting .NET 7
- Replace Global.asax with Program.cs using minimal hosting model
- Convert Web.config to appsettings.json configuration
- Update bundling from System.Web.Optimization to WebOptimizer.Core
- Update LandingController to use ASP.NET Core base classes
- Update Index.cshtml to use new bundling approach
- Add Properties/launchSettings.json for development server
- Remove legacy files (Global.asax, Web.config, packages.config, App_Start)
- Preserve AngularJS frontend functionality

Co-Authored-By: Jia Wu <[email protected]>
- Delete Global.asax and Global.asax.cs (replaced by Program.cs)
- Delete Web.config and related config files (replaced by appsettings.json)
- Delete packages.config (replaced by PackageReference)
- Delete App_Start directory (BundleConfig.cs and RouteConfig.cs moved to Program.cs)
- Delete Views/web.config (no longer needed in ASP.NET Core)

Co-Authored-By: Jia Wu <[email protected]>
…ment

- Update package reference to correct LigerShark.WebOptimizer.Core
- Remove explicit WebOptimizer using statement (not needed)
- Remove Properties/AssemblyInfo.cs to avoid duplicate attributes

Co-Authored-By: Jia Wu <[email protected]>
- Update target framework from net7.0 to net8.0 (LTS version)
- Remove WebOptimizer dependency and use direct script/CSS references
- Update Microsoft.Extensions.FileProviders.Physical to 8.0.0
- Simplify Program.cs to use basic static file serving
- Update view titles to reflect .NET 8
- Application now builds successfully without warnings

Co-Authored-By: Jia Wu <[email protected]>
- Add static file serving for /WebApp directory (AngularJS files)
- Add static file serving for /Content directory (CSS files)
- This resolves 404 errors for app.js, components, directives, and site.css

Co-Authored-By: Jia Wu <[email protected]>
- Update script src paths to use correct filenames (test.component.js, test.directive.js)
- Fixes 404 errors for AngularJS component and directive files

Co-Authored-By: Jia Wu <[email protected]>
@devin-ai-integration
Copy link
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant