From 518a6899e01faa984290a7be9f69e517cddfff90 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 5 May 2026 14:25:33 +0000 Subject: [PATCH 1/3] chore(net8): upgrade AspNetCore/Vue2/AdvancedSearch to .NET 8 - Bump TFM to net8.0 - Upgrade EF Core (Sqlite, SqlServer) to 8.0.26 - Upgrade Microsoft.Data.SqlClient to 5.2.3 - Upgrade Microsoft.IdentityModel.JsonWebTokens / System.IdentityModel.Tokens.Jwt to 7.7.1 - Replace VueCliMiddleware with Microsoft.AspNetCore.SpaProxy 8.0.26 - Add SpaProxyServerUrl / SpaProxyLaunchCommand MSBuild properties - Remove Microsoft.AspNetCore.SpaServices.Extensions - Remove Newtonsoft.Json (no C# usages) - Remove System.Data.SqlClient, System.Net.Http, System.Text.RegularExpressions, System.Drawing.Common - Startup.cs: drop UseSpaStaticFiles / AddSpaStaticFiles / UseSpa / UseVueCli; use MapFallbackToFile("index.html") for SPA fallback Co-Authored-By: Toby Drinkall --- ...qDemo.AspNetCoreVue2.AdvancedSearch.csproj | 24 +++++++--------- AspNetCore/Vue2/AdvancedSearch/Startup.cs | 28 +------------------ 2 files changed, 11 insertions(+), 41 deletions(-) diff --git a/AspNetCore/Vue2/AdvancedSearch/EqDemo.AspNetCoreVue2.AdvancedSearch.csproj b/AspNetCore/Vue2/AdvancedSearch/EqDemo.AspNetCoreVue2.AdvancedSearch.csproj index b84cd155..5f99eb2d 100644 --- a/AspNetCore/Vue2/AdvancedSearch/EqDemo.AspNetCoreVue2.AdvancedSearch.csproj +++ b/AspNetCore/Vue2/AdvancedSearch/EqDemo.AspNetCoreVue2.AdvancedSearch.csproj @@ -1,8 +1,10 @@ - net6.0 + net8.0 3.0 ClientApp\ + http://localhost:8085 + npm run serve -- --port 8085 $(DefaultItemExcludes);$(SpaRoot)node_modules\** EqDemo.AspNetCoreVue.AdvancedSearch true @@ -10,18 +12,12 @@ - - - - - - - - - - - - + + + + + + @@ -65,4 +61,4 @@ - \ No newline at end of file + diff --git a/AspNetCore/Vue2/AdvancedSearch/Startup.cs b/AspNetCore/Vue2/AdvancedSearch/Startup.cs index e1fcb214..220c2002 100644 --- a/AspNetCore/Vue2/AdvancedSearch/Startup.cs +++ b/AspNetCore/Vue2/AdvancedSearch/Startup.cs @@ -7,8 +7,6 @@ using Microsoft.Extensions.Hosting; using Microsoft.EntityFrameworkCore; -using VueCliMiddleware; - using Korzh.EasyQuery.Services; using EasyData.Export; @@ -44,12 +42,6 @@ public void ConfigureServices(IServiceCollection services) services.AddControllersWithViews(); - // In production, the React files will be served from this directory - services.AddSpaStaticFiles(configuration => - { - configuration.RootPath = "ClientApp/dist"; - }); - services.AddEasyQuery() .UseSqlManager() .AddDefaultExporters() @@ -78,11 +70,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) app.UseHttpsRedirection(); app.UseStaticFiles(); - if (!env.IsDevelopment()) { - app.UseSpaStaticFiles(); - } - app.UseRouting(); app.UseEndpoints(endpoints => @@ -103,24 +91,10 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) endpoints.MapControllerRoute( name: "default", pattern: "{controller}/{action=Index}/{id?}"); - }); - app.UseSpa(spa => - { - spa.Options.SourcePath = "ClientApp"; - spa.Options.StartupTimeout = TimeSpan.FromMinutes(2); - - if (env.IsDevelopment()) - { - // run npm process with client app - spa.UseVueCli(npmScript: "serve", port: 8085, regex: "Compiled "); - // if you just prefer to proxy requests from client app, use proxy to SPA dev server instead: - // app should be already running before starting a .NET client - // spa.UseProxyToSpaDevelopmentServer("http://localhost:8080"); // your Vue app port - } + endpoints.MapFallbackToFile("index.html"); }); - //Init demo database (if necessary) app.EnsureDbInitialized(Configuration, env); } From 037108bf4f73823906f5790bf4526e987caaa89b Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 5 May 2026 14:30:25 +0000 Subject: [PATCH 2/3] fix(net8): set ASPNETCORE_HOSTINGSTARTUPASSEMBLIES for SpaProxy activation Microsoft.AspNetCore.SpaProxy ships its proxy/launch behavior via a HostingStartup assembly. Without the ASPNETCORE_HOSTINGSTARTUPASSEMBLIES env var pointing at it, the proxy middleware is never loaded and the Vue dev server is not auto-launched in Development. Mirror the pattern used by the Angular and Vue3 sibling projects' launchSettings.json. Co-Authored-By: Toby Drinkall --- .../Vue2/AdvancedSearch/Properties/launchSettings.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/AspNetCore/Vue2/AdvancedSearch/Properties/launchSettings.json b/AspNetCore/Vue2/AdvancedSearch/Properties/launchSettings.json index c990ef22..36cedca8 100644 --- a/AspNetCore/Vue2/AdvancedSearch/Properties/launchSettings.json +++ b/AspNetCore/Vue2/AdvancedSearch/Properties/launchSettings.json @@ -12,14 +12,16 @@ "commandName": "IISExpress", "launchBrowser": true, "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" + "ASPNETCORE_ENVIRONMENT": "Development", + "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.SpaProxy" } }, "EqVueDemo": { "commandName": "Project", "launchBrowser": true, "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" + "ASPNETCORE_ENVIRONMENT": "Development", + "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.SpaProxy" }, "applicationUrl": "https://localhost:5001;http://localhost:5000" } From a43169e78da1d77d7a7edfd7497f4d29c2de9a24 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 5 May 2026 14:34:20 +0000 Subject: [PATCH 3/3] fix(net8): map published Vue dist/ into wwwroot for production serving Without AddSpaStaticFiles/UseSpaStaticFiles, app.UseStaticFiles() and MapFallbackToFile both look in wwwroot. Update the PublishRunWebpack target to: - reference the actual Vue CLI output dir (dist, not build), and - rewrite RelativePath so files land under wwwroot/ in the publish output. Mirrors the pattern from AspNetCore/Angular/AdvancedSearch's csproj so production routes resolve to the prebuilt SPA assets and index.html is correctly served as the SPA fallback. Co-Authored-By: Toby Drinkall --- .../EqDemo.AspNetCoreVue2.AdvancedSearch.csproj | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/AspNetCore/Vue2/AdvancedSearch/EqDemo.AspNetCoreVue2.AdvancedSearch.csproj b/AspNetCore/Vue2/AdvancedSearch/EqDemo.AspNetCoreVue2.AdvancedSearch.csproj index 5f99eb2d..94ade34e 100644 --- a/AspNetCore/Vue2/AdvancedSearch/EqDemo.AspNetCoreVue2.AdvancedSearch.csproj +++ b/AspNetCore/Vue2/AdvancedSearch/EqDemo.AspNetCoreVue2.AdvancedSearch.csproj @@ -52,12 +52,13 @@ - + - + - %(DistFiles.Identity) + wwwroot\%(RecursiveDir)%(FileName)%(Extension) PreserveNewest + true