Skip to content

chore: upgrade EqDemo.AspNetCoreVue2.AdvancedSearch to .NET 8.0#19

Open
devin-ai-integration[bot] wants to merge 5 commits intomasterfrom
upgrade/vue2-advancedsearch-to-net8
Open

chore: upgrade EqDemo.AspNetCoreVue2.AdvancedSearch to .NET 8.0#19
devin-ai-integration[bot] wants to merge 5 commits intomasterfrom
upgrade/vue2-advancedsearch-to-net8

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot commented Apr 7, 2026

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.0
  • Microsoft.EntityFrameworkCore.Sqlite: 6.0.1 → 8.0.11
  • Microsoft.EntityFrameworkCore.SqlServer: 6.0.1 → 8.0.11
  • Microsoft.Data.SqlClient: 2.1.7 → 5.2.2
  • Microsoft.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:

  • Removed Microsoft.AspNetCore.SpaServices.Extensions (discontinued in .NET 8)
  • Removed VueCliMiddleware (depends on SpaServices.Extensions)
  • Added Microsoft.AspNetCore.SpaProxy 8.0.11 with SpaProxyLaunchCommand / SpaProxyServerUrl config
  • SpaProxyLaunchCommand set to npm run serve -- --port 8085 to match the old UseVueCli(port: 8085) behavior (without --port, Vue CLI defaults to 8080, mismatching the proxy URL)
  • Replaced AddSpaStaticFiles / UseSpaStaticFiles / UseSpa / UseVueCli in Startup.cs with static file middleware configured to serve from ClientApp/dist and MapFallbackToFile("index.html")

SpaProxy activation fix:

  • Added ASPNETCORE_HOSTINGSTARTUPASSEMBLIES: Microsoft.AspNetCore.SpaProxy to both IIS Express and EqVueDemo profiles in launchSettings.json, matching the pattern used by the Vue3 and Angular projects in this repo.

Production static file serving fix:

  • UseDefaultFiles and UseStaticFiles now use a PhysicalFileProvider pointing to ClientApp/dist (guarded by Directory.Exists so dev mode still works when dist hasn't been built).
  • MapFallbackToFile("index.html") also configured with the ClientApp/dist file provider and guarded by Directory.Exists to prevent DirectoryNotFoundException in dev mode.
  • Fixed PublishRunWebpack target in the csproj to reference ClientApp\dist\** instead of ClientApp\build\** (Vue CLI outputs to dist by default — this was a pre-existing bug).

dotnet restore and dotnet build pass with 0 warnings, 0 errors. The app has not been tested at runtime.

Review & Testing Checklist for Human

  • Verify dev-mode SPA proxy launches on the correct port: The SpaProxyLaunchCommand is npm run serve -- --port 8085. Confirm the -- separator correctly forwards --port 8085 to vue-cli-service serve and that the Vue dev server actually starts on 8085 (not the default 8080). If it doesn't, a vue.config.js with devServer.port: 8085 may be needed instead.
  • Verify dev-mode fallback routing without ClientApp/dist: Since both UseStaticFiles(ClientApp/dist) and MapFallbackToFile are guarded by Directory.Exists, in a clean dev checkout (no prior npm 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 unconditional MapFallbackToFile that serves from wwwroot or a similar fallback.
  • Verify production static file serving: Run npm run build in ClientApp/, then start the app in Production mode. Confirm built assets in ClientApp/dist/ are served correctly and that refreshing on a deep link returns index.html via MapFallbackToFile.
  • Verify EasyQuery API routes still take priority over the fallback: confirm calls to /api/easyquery/... are not caught by MapFallbackToFile.
  • Test a full run of the app end-to-end: Build succeeds but the app was not tested at runtime. Run the project locally, verify the EasyQuery advanced search UI loads, and confirm API calls still work.

Suggested test plan:

  1. cd AspNetCore/Vue2/AdvancedSearch && dotnet run — verify app starts without errors, SPA proxy launches Vue dev server on port 8085
  2. Open https://localhost:5001 — confirm the advanced search UI renders
  3. Perform a search query — confirm the EasyQuery API responds correctly
  4. Run cd ClientApp && npm run build, restart app without ASPNETCORE_ENVIRONMENT=Development — confirm production static serving works

Notes

  • The IdentityModel bumps (6.34.0 → 6.35.0) were not in the original requirements but were necessary to resolve NU1605 package downgrade errors caused by Microsoft.Data.SqlClient 5.2.2.
  • using System; is now unused in Startup.cs (was only needed for TimeSpan in the removed UseSpa block) — harmless but could be cleaned up.
  • Legacy 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


Open with Devin

- 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>
@devin-ai-integration
Copy link
Copy Markdown
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

devin-ai-integration[bot]

This comment was marked as resolved.

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>
devin-ai-integration[bot]

This comment was marked as resolved.

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>
devin-ai-integration[bot]

This comment was marked as resolved.

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>
devin-ai-integration[bot]

This comment was marked as resolved.

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>
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