Skip to content

Conversation

@devin-ai-integration
Copy link

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

Summary

This PR migrates the application from .NET Framework 4.8 / ASP.NET MVC 5 to ASP.NET Core 7 Web API. The AngularJS frontend remains unchanged and is now served as static files from the wwwroot directory.

Key Changes:

  • Project File: Converted to SDK-style .csproj targeting net7.0
  • Application Entry: Created Program.cs with minimal API setup, static file serving, and CORS middleware
  • Static Files: Moved all frontend assets (Content/, WebApp/) to wwwroot/ directory
  • HTML Bootstrap: Converted Views/Landing/Index.cshtml (Razor) to wwwroot/index.html (static HTML)
  • Dependencies: Copied jQuery and Angular from node_modules to wwwroot/lib/
  • Removed: All .NET Framework-specific files (Global.asax, Web.config, BundleConfig, RouteConfig, Controllers, Views, etc.)

What Stayed the Same:

  • AngularJS application structure (wwwroot/WebApp/app.js, components, directives) - completely unchanged
  • Application port: http://localhost:51267
  • npm dependencies and package.json

Review & Testing Checklist for Human

⚠️ Important: I was unable to test this locally as .NET SDK 7.0 is not installed in the development environment. All verification must be done by the reviewer.

  • Build Verification: Run dotnet build and confirm it succeeds without errors
  • Run Application: Execute dotnet run and verify the app starts on http://localhost:51267
  • Visual Verification: Open the app in a browser and confirm:
    • Page loads with title "XLTS for AngularJS with ASP.NET Core 7"
    • test-component displays "AngularJS Version: 1.8.3"
    • test-directive displays "jQuery Version: 3.6.3"
    • No console errors in browser developer tools
  • Static File Paths: Verify all CSS and JS files load correctly (check Network tab in browser dev tools)
  • Production Considerations: Evaluate whether to add bundling/minification for production deployments (the old app used ASP.NET bundling, which was removed for simplicity)

Notes

  • The CORS policy is configured for http://localhost:51267, though it may not be necessary since the frontend is served from the same origin
  • The AngularJS directive uses templateUrl: 'WebApp/Directives/test.directive.html' which should resolve correctly from the new wwwroot structure, but verify it loads
  • E2E tests in the e2e/ directory may need updates if they expect specific server behavior

Link to Devin run: https://app.devin.ai/sessions/0b11c65824f24ab39115ea5807e3b32a
Requested by: Kevin Tang (@kevintang513)

… API

- Convert project to SDK-style .csproj targeting net7.0
- Create Program.cs with static file serving and CORS middleware
- Convert Index.cshtml to static index.html in wwwroot
- Move all static assets (Content, WebApp) to wwwroot directory
- Copy jQuery and Angular libraries to wwwroot/lib
- Configure Kestrel to listen on port 51267
- Remove old .NET Framework files (Global.asax, Web.config, Controllers, Views, etc.)
- AngularJS frontend structure remains unchanged in wwwroot/WebApp

The application now serves the AngularJS frontend as static files from wwwroot.
API controller infrastructure is in place for future API endpoints.

Co-Authored-By: Kevin Tang <[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