chore: upgrade EqDemo.AspNetCoreVue2.AdvancedSearch to .NET 8.0#19
Open
devin-ai-integration[bot] wants to merge 5 commits intomasterfrom
Open
chore: upgrade EqDemo.AspNetCoreVue2.AdvancedSearch to .NET 8.0#19devin-ai-integration[bot] wants to merge 5 commits intomasterfrom
devin-ai-integration[bot] wants to merge 5 commits intomasterfrom
Conversation
- Update TargetFramework from net6.0 to net8.0 - Update Microsoft.EntityFrameworkCore.Sqlite 6.0.1 -> 8.0.11 - Update Microsoft.EntityFrameworkCore.SqlServer 6.0.1 -> 8.0.11 - Update Microsoft.Data.SqlClient 2.1.7 -> 5.2.2 - Bump Microsoft.IdentityModel.JsonWebTokens and System.IdentityModel.Tokens.Jwt to 6.35.0 (required by SqlClient 5.2.2) - Remove Microsoft.AspNetCore.SpaServices.Extensions (removed in .NET 8) - Remove VueCliMiddleware (incompatible with .NET 8) - Add Microsoft.AspNetCore.SpaProxy 8.0.11 with SPA proxy configuration - Update Startup.cs to replace old SPA middleware with UseDefaultFiles, UseStaticFiles, and MapFallbackToFile Co-Authored-By: Toby Drinkall <toby.drinkall@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:
|
Add the required environment variable to both IIS Express and EqVueDemo profiles in launchSettings.json so Microsoft.AspNetCore.SpaProxy's hosting startup assembly is activated during development. Co-Authored-By: Toby Drinkall <toby.drinkall@cognition.ai>
Configure UseStaticFiles, UseDefaultFiles, and MapFallbackToFile with a PhysicalFileProvider pointing to ClientApp/dist so the Vue build output is served correctly in production (wwwroot does not exist in this project). Also fix PublishRunWebpack target to reference ClientApp/dist instead of ClientApp/build (Vue CLI outputs to dist by default). Co-Authored-By: Toby Drinkall <toby.drinkall@cognition.ai>
Wrap the MapFallbackToFile registration in a Directory.Exists guard to prevent PhysicalFileProvider from throwing DirectoryNotFoundException when ClientApp/dist doesn't exist in development mode. Co-Authored-By: Toby Drinkall <toby.drinkall@cognition.ai>
The old VueCliMiddleware explicitly started the dev server on port 8085. Without the --port flag, npm run serve defaults to 8080, causing a mismatch with SpaProxyServerUrl which expects 8085. Co-Authored-By: Toby Drinkall <toby.drinkall@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
Upgrades the Vue2 AdvancedSearch sample project from .NET 6.0 to .NET 8.0, including handling two breaking changes around SPA middleware.
Package updates:
TargetFramework: net6.0 → net8.0Microsoft.EntityFrameworkCore.Sqlite: 6.0.1 → 8.0.11Microsoft.EntityFrameworkCore.SqlServer: 6.0.1 → 8.0.11Microsoft.Data.SqlClient: 2.1.7 → 5.2.2Microsoft.IdentityModel.JsonWebTokens: 6.34.0 → 6.35.0 (required by SqlClient 5.2.2)System.IdentityModel.Tokens.Jwt: 6.34.0 → 6.35.0 (required by SqlClient 5.2.2)Breaking change — SPA middleware replacement:
Microsoft.AspNetCore.SpaServices.Extensions(discontinued in .NET 8)VueCliMiddleware(depends on SpaServices.Extensions)Microsoft.AspNetCore.SpaProxy8.0.11 withSpaProxyLaunchCommand/SpaProxyServerUrlconfigSpaProxyLaunchCommandset tonpm run serve -- --port 8085to match the oldUseVueCli(port: 8085)behavior (without--port, Vue CLI defaults to 8080, mismatching the proxy URL)AddSpaStaticFiles/UseSpaStaticFiles/UseSpa/UseVueCliinStartup.cswith static file middleware configured to serve fromClientApp/distandMapFallbackToFile("index.html")SpaProxy activation fix:
ASPNETCORE_HOSTINGSTARTUPASSEMBLIES: Microsoft.AspNetCore.SpaProxyto both IIS Express and EqVueDemo profiles inlaunchSettings.json, matching the pattern used by the Vue3 and Angular projects in this repo.Production static file serving fix:
UseDefaultFilesandUseStaticFilesnow use aPhysicalFileProviderpointing toClientApp/dist(guarded byDirectory.Existsso dev mode still works whendisthasn't been built).MapFallbackToFile("index.html")also configured with theClientApp/distfile provider and guarded byDirectory.Existsto preventDirectoryNotFoundExceptionin dev mode.PublishRunWebpacktarget in the csproj to referenceClientApp\dist\**instead ofClientApp\build\**(Vue CLI outputs todistby default — this was a pre-existing bug).dotnet restoreanddotnet buildpass with 0 warnings, 0 errors. The app has not been tested at runtime.Review & Testing Checklist for Human
SpaProxyLaunchCommandisnpm run serve -- --port 8085. Confirm the--separator correctly forwards--port 8085tovue-cli-service serveand that the Vue dev server actually starts on 8085 (not the default 8080). If it doesn't, avue.config.jswithdevServer.port: 8085may be needed instead.ClientApp/dist: Since bothUseStaticFiles(ClientApp/dist)andMapFallbackToFileare guarded byDirectory.Exists, in a clean dev checkout (no priornpm run build), deep-link refreshes rely entirely on SPA proxy forwarding to the Vue dev server. Confirm this works — if not, you may need an unconditionalMapFallbackToFilethat serves fromwwwrootor a similar fallback.npm run buildinClientApp/, then start the app in Production mode. Confirm built assets inClientApp/dist/are served correctly and that refreshing on a deep link returnsindex.htmlviaMapFallbackToFile./api/easyquery/...are not caught byMapFallbackToFile.Suggested test plan:
cd AspNetCore/Vue2/AdvancedSearch && dotnet run— verify app starts without errors, SPA proxy launches Vue dev server on port 8085https://localhost:5001— confirm the advanced search UI renderscd ClientApp && npm run build, restart app withoutASPNETCORE_ENVIRONMENT=Development— confirm production static serving worksNotes
NU1605package downgrade errors caused byMicrosoft.Data.SqlClient 5.2.2.using System;is now unused inStartup.cs(was only needed forTimeSpanin the removedUseSpablock) — harmless but could be cleaned up.System.*compatibility packages (System.Drawing.Common,System.Net.Http,System.Text.RegularExpressions,System.Data.SqlClient) were left as-is since the build succeeds; they could be pruned in a follow-up.Link to Devin session: https://app.devin.ai/sessions/57f8e9e2c06d4895bf6f3e593e59d029
Requested by: @tobydrinkall