Migrate SampleMvcWebApp from .NET Framework 4.5.1 (ASP.NET MVC5) to .NET 8#16
Open
devin-ai-integration[bot] wants to merge 2 commits intomasterfrom
Open
Migrate SampleMvcWebApp from .NET Framework 4.5.1 (ASP.NET MVC5) to .NET 8#16devin-ai-integration[bot] wants to merge 2 commits intomasterfrom
devin-ai-integration[bot] wants to merge 2 commits intomasterfrom
Conversation
…NET 8 - Convert all 4 projects to SDK-style .csproj targeting net8.0 - Migrate EF6 to EF Core 8 with SQLite provider - Replace Autofac DI with Microsoft.Extensions.DependencyInjection - Replace Global.asax with Program.cs (minimal hosting model) - Replace Web.config with appsettings.json - Update Razor views with ASP.NET Core tag helpers and conventions - Refactor GenericServices DTOs to plain DTOs - Update all controllers to ASP.NET Core MVC with constructor injection - Remove obsolete files (packages.config, AssemblyInfo.cs, App_Start, etc.) Co-Authored-By: Achal Channarasappa <achal.channarasappa@cognition.ai>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
…ute() The XML seed data files use child elements (<Name>, <Slug>, etc.) not attributes. This caused a NullReferenceException at startup during database seeding. Co-Authored-By: Achal Channarasappa <achal.channarasappa@cognition.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Full migration of the SampleMvcWebApp from .NET Framework 4.5.1 / ASP.NET MVC5 to .NET 8 / ASP.NET Core MVC. The solution compiles successfully (
dotnet build— 0 errors, 0 warnings) and runs cross-platform viadotnet run --project SampleWebApp.What changed across all 4 project layers:
Deleted files (non-exhaustive):
packages.config,App.config,AssemblyInfo.cs,Web.config,Web.*.configGlobal.asax,Global.asax.cs,App_Start/(BundleConfig, RouteConfig, FilterConfig)AutofacDi.cs,DiModelBinder.cs,*Module.cs)WebUiInitialise.cs,Log4NetGenericLogger.cs,TraceGenericLogger.cs,JsonNetResult.cs)EditorTemplates/)Added files:
Program.cs,appsettings.json,appsettings.Development.json_ViewImports.cshtml,wwwroot/css/site.cssDataLayerServiceCollectionExtensions.cs,ServiceLayerServiceCollectionExtensions.csLocal testing screenshots
Home page:

Posts page (with seeded data):

Tags page:

Updates since initial commit
LoadDbDataFromXml.cs: The XML seed data files use child elements (<Name>,<Slug>, etc.), not attributes. The initial rewrite incorrectly used.Attribute()instead of.Element(), causing aNullReferenceExceptionat startup during database seeding. Fixed in second commit.Review & Testing Checklist for Human
PostsController,PostsAsyncController, andBlogsControllerfor correctness — especially the Edit actions that handle related entities (Bloggers dropdown, Tags multi-select). The DTO population and save-back logic is the highest-risk area. Verify by exercising the Post create/edit/delete flow end-to-end.UseSqlServer()with an appropriate connection string.Tests.csprojstill references the old format and is excluded from the build. No automated tests were run against the new code.LoadDbDataFromXml.cscarefully and verify the seed data loads completely (all blogs, posts, and tags).DetailPostDto/DetailPostDtoAsyncclasses use customDropDownListTypeandMultiSelectListTypefor Blogger selection and Tag multi-select. These are populated manually in controllers and rendered via custom markup in the views. Test that form POST model binding round-trips correctly.Recommended test plan: Run
dotnet run --project SampleWebApp, then exercise: (1) list posts, (2) create a new post with blogger and tags, (3) edit an existing post, (4) delete a post, (5) repeat for Tags and Blogs pages, (6) try the async variants (/PostsAsync,/TagsAsync).Notes
InternalsInfo.AvailableMbyteswas removed becausePerformanceCounteris Windows-only. The Internals view was updated accordingly — this is a minor functionality loss.@Html.ActionLink,@Html.BeginForm,@Html.EditorForetc. These work in ASP.NET Core but are not fully converted to tag helpers. Only the Post edit/create forms and the layout were converted to tag helpers.Link to Devin session: https://app.devin.ai/sessions/5d833fd90ac2449693a89e1d2cdfc16a
Requested by: @achalc