Skip to content

Conversation

@devin-ai-integration
Copy link

Migrate from .NET Framework 4.8 to .NET 7

Summary

This PR migrates the ASP.NET MVC 5 application from .NET Framework 4.8 (Windows-only) to .NET 7 (cross-platform). The migration includes:

  • Project file: Converted from legacy .csproj format to modern SDK-style targeting net7.0
  • Application startup: Replaced Global.asax with Program.cs using ASP.NET Core's minimal hosting model
  • Configuration: Migrated from Web.config (XML) to appsettings.json and launchSettings.json
  • Static files: Replaced System.Web.Optimization bundling with manual <script> and <link> tags and custom static file providers for node_modules/, Content/, and WebApp/ directories
  • Controllers: Updated LandingController to use Microsoft.AspNetCore.Mvc base classes (IActionResult instead of ActionResult)
  • Views: Removed bundling directives and added explicit resource references
  • Deleted files: Removed all .NET Framework-specific files (Global.asax, Web.config, BundleConfig.cs, RouteConfig.cs, AssemblyInfo.cs, packages.config)
  • Hosting: Transitioned from IIS Express to Kestrel web server on port 51267
  • Client-side code: All AngularJS and jQuery code remains completely unchanged

The application now runs cross-platform on Windows, macOS, and Linux.

Review & Testing Checklist for Human

  • Verify static file serving - Open the app in a browser and check that all CSS styles are applied and all JavaScript files load without 404 errors (check browser DevTools Network tab). This is the most critical change - the custom static file configuration serves from non-standard directories.
  • Test AngularJS functionality end-to-end - Verify that the AngularJS components (test-component) and directives (test-directive) render correctly and display the expected jQuery and AngularJS versions. The automated tests only verify text content, not full functionality.
  • Run the app locally - Execute dotnet build and dotnet run, then navigate to http://localhost:51267 to verify the application starts correctly and displays the landing page with title "XLTS for AngularJS with .NET 7".
  • Review the static file configuration in Program.cs - The PhysicalFileProvider setup for node_modules, Content, and WebApp directories is non-standard. Verify this approach aligns with your deployment strategy.

Test Plan

  1. Clone the PR branch
  2. Run npm install to install frontend dependencies
  3. Run dotnet build to verify compilation
  4. Run dotnet run to start the server
  5. Navigate to http://localhost:51267 in your browser
  6. Verify the page displays "XLTS for AngularJS with .NET 7" as the title
  7. Verify the page displays "AngularJS Version: 1.8.3" and "jQuery Version: 3.7.0"
  8. Check browser DevTools Console for any JavaScript errors
  9. Check browser DevTools Network tab to ensure all resources loaded (no 404s)
  10. Run npm run e2e to execute Playwright tests

Notes

  • Verified on Linux/Ubuntu with .NET SDK 8.0.411 and Node.js
  • All 3 Playwright end-to-end tests pass
  • Build completed successfully with 0 errors (only warnings about .NET 7 being out of support, which is expected)
  • No .NET Framework references remain in the codebase (verified via search)
  • Port 51267 maintained to preserve compatibility with existing Playwright test configuration
  • The test expectations were updated to match the installed npm package versions (jQuery 3.7.0, AngularJS 1.8.3)

Link to Devin run: https://app.devin.ai/sessions/c2a5ce64da394e19b083e338a142727d
Requested by: Jia Wu (@JRWu)

- Convert to SDK-style project targeting net7.0
- Replace ASP.NET MVC 5 with ASP.NET Core MVC
- Migrate from Global.asax to Program.cs with minimal hosting model
- Replace System.Web.Optimization bundling with manual script/link tags
- Configure static file serving from node_modules, Content, and WebApp directories
- Migrate Web.config to appsettings.json
- Update LandingController to use ASP.NET Core base classes (IActionResult)
- Update Index.cshtml for ASP.NET Core compatibility
- Create launchSettings.json for Kestrel configuration on port 51267
- Update Playwright tests for .NET 7 title and correct npm package versions
- Update README with .NET 7 prerequisites and cross-platform compatibility
- Delete obsolete .NET Framework files (Global.asax, Web.config, BundleConfig, RouteConfig, AssemblyInfo, packages.config)
- Preserve all client-side AngularJS and jQuery code unchanged

Verification completed:
- dotnet build: SUCCESS
- dotnet run: SUCCESS
- All 3 Playwright e2e tests: PASSED
- No .NET Framework references remain in codebase

Co-Authored-By: Jia Wu <jia_wu@hotmail.ca>
@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.

0 participants