Skip to content

Conversation

@devin-ai-integration
Copy link

Migrate Backend from ASP.NET MVC 5 to ASP.NET Core 7 Web API

Summary

This PR completes a full migration from ASP.NET MVC 5 (.NET Framework 4.8) to ASP.NET Core 7 Web API while preserving the existing AngularJS frontend. The application now serves the AngularJS SPA as static files through ASP.NET Core Web API infrastructure.

Key Changes:

  • Replaced old .csproj with SDK-style format targeting .NET 7.0
  • Created Program.cs with minimal hosting model and static file serving
  • Converted Index.cshtml (Razor view) to plain index.html
  • Replaced ASP.NET bundling with direct script/style references
  • Added sample HealthController API endpoint (/api/health)
  • Removed all .NET Framework files (Global.asax, Web.config, etc.)
  • Updated README with new setup instructions

Local Testing Results:
Frontend Screenshot
API Endpoint Screenshot

Review & Testing Checklist for Human

Please verify these 4 critical areas:

  • Static file serving works correctly - Verify all CSS/JS files load properly by checking browser network tab and ensuring no 404 errors (except favicon.ico which is expected)
  • AngularJS components render correctly - Verify the test-directive shows "jQuery Version: 3.7.0" and test-component shows "AngularJS Version: 1.8.3"
  • API endpoint functionality - Test /api/health returns proper JSON response with correct status, timestamp, version, and framework fields
  • Build and run successfully - Verify dotnet run --project angularjs-aspnetcore7.csproj starts without errors and serves content on localhost:5000

Test Plan:

  1. Run dotnet restore and dotnet build angularjs-aspnetcore7.csproj to verify clean build
  2. Run dotnet run --project angularjs-aspnetcore7.csproj
  3. Navigate to http://localhost:5000 and verify AngularJS app loads completely
  4. Check browser console for JavaScript errors (favicon 404 is expected/harmless)
  5. Test API endpoint at http://localhost:5000/api/health
  6. Verify Swagger UI works at http://localhost:5000/swagger (development mode only)

Notes

  • .NET 7.0 shows end-of-life warnings during build - this is expected as per user requirements
  • The frontend code (WebApp/, Content/, node_modules/) remains completely unchanged
  • Static file middleware serves files from project root, preserving existing file structure
  • Only minor favicon.ico 404 error in console - this doesn't affect functionality

Link to Devin run: https://app.devin.ai/sessions/0d4ce359003a439da853c34af83c0066
Requested by: [email protected]

… API

- Replace old .csproj with SDK-style format targeting .NET 7.0
- Create Program.cs with minimal hosting model
- Configure static file serving for AngularJS SPA
- Convert Index.cshtml to index.html (remove Razor syntax)
- Replace bundling with direct script/style references
- Add sample API controller (/api/health endpoint)
- Create appsettings.json configuration files
- Remove all .NET Framework specific files (Global.asax, Web.config, etc.)
- Update README with new ASP.NET Core 7 setup instructions
- Update .gitignore for ASP.NET Core

Tested locally:
- Project builds successfully
- AngularJS frontend loads with all components working
- Test directive displays jQuery 3.7.0
- Test component displays AngularJS 1.8.3
- API health endpoint returns correct JSON response

Co-Authored-By: [email protected] <[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