Open Closed

Unhandled exception after updating from 9.2.0 to 9.3.0; issues with adapting to App.razor #10527


User avatar
0
lba created

We're currently updating our framework version from 8.2.2, following the migration guides step by step.

Upon updating from 9.2.0 to 9.3.0, the following Exception occurs:

System.ArgumentException: The path in 'value' must start with '/'. (Parameter 'value')
   at Microsoft.AspNetCore.Http.PathString..ctor(String value)
   at Microsoft.AspNetCore.Mvc.Routing.UrlHelperBase.Content(HttpContext httpContext, String contentPath)
   at Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers.AbpTagHelperScriptService.AddHtmlTag(ViewContext viewContext, TagHelper tagHelper, TagHelperContext context, TagHelperOutput output, BundleFile file, IFileInfo fileInfo)
   at Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers.AbpTagHelperResourceService.ProcessAsync(ViewContext viewContext, TagHelper tagHelper, TagHelperContext context, TagHelperOutput output, List`1 bundleItems, String bundleName)
   at Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers.AbpBundleTagHelperService`2.ProcessAsync(TagHelperContext context, TagHelperOutput output)
   at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner.<RunAsync>g__Awaited|0_0(Task task, TagHelperExecutionContext executionContext, Int32 i, Int32 count)
   at Ipoox.Omm.Blazor.Pages.Pages__Host.<>c__DisplayClass22_0.<<ExecuteAsync>b__1>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext.SetOutputContentAsync()
   at Ipoox.Omm.Blazor.Pages.Pages__Host.ExecuteAsync() in C:\Users\LBA\source\repos\omm\src\Ipoox.Omm.Blazor\Pages\_Host.cshtml:line 16
   at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context)
   at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, Boolean invokeViewStarts)
   at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context)
   at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode)
   at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|30_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeResultFilters>g__Awaited|28_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|7_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Volo.Abp.AspNetCore.Serilog.AbpSerilogMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Volo.Abp.AspNetCore.Auditing.AbpAuditingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Volo.Abp.AspNetCore.Auditing.AbpAuditingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Volo.Abp.AspNetCore.Uow.AbpUnitOfWorkMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Volo.Abp.AspNetCore.ExceptionHandling.AbpExceptionHandlingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Volo.Abp.AspNetCore.ExceptionHandling.AbpExceptionHandlingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Volo.Abp.AspNetCore.MultiTenancy.MultiTenancyMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Builder.ApplicationBuilderAbpOpenIddictMiddlewareExtension.<>c__DisplayClass0_0.<<UseAbpOpenIddictValidation>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Volo.Abp.AspNetCore.Security.AbpSecurityHeadersMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Volo.Abp.AspNetCore.Tracing.AbpCorrelationIdMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.RequestLocalization.AbpRequestLocalizationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)

What we did for this to occur:

  • We ran abp update -v 9.3.0 on our 9.2.0 solution
  • Additionally, updated Blazorise from 1.7.6 to 1.8.8
  • We're using a customized old Lepton Theme, which we suspect to be an issue. Further information below.

What we've tried: Update our solution according to this thread, i.e. replace _Host.cshtml with App.razor according to 10.1.0 template. This partially resolved the issue - the above exception is no longer thrown.

Problems that remain:

  • We cannot find a suitable value for AuthorizeRouteView.DefaultLayout in the new Routes.razor. The 10.1.0 template, using LeptonX theme, injects IOptions<LeptonXThemeBlazorOptions> and uses it's Layout property which the old Lepton theme does not seem to have an analogous way of doing
  • The code in Index.razor generated by abp update has the error 'PageLayout' does not contain a definition for 'ShowToolbar'
  • The navbar is missing in the application, although we assume this is due to one of the problems described above.

How can we resolve these problems? Is there something wrong with our approach of replacing _Host.cshtml with App.razor? Do we have to migrate from the old Lepton theme?

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

9 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you create a private GitHub repository and upload your project?

    Invite https://github.com/maliming, and I will check and fix it.

    Thanks.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    lba created

    Hi maliming, I have to acquire permission internally, I'll get back to you on monday.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    ok, no problem.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    lba created

    Hello,

    sorry for the delayed response. I have invited you to the repository. Default branch is where our solution is still on v8.2.2. I have updated up to v9.2.0 on abp-version-updates. Let me know if you need any further information. Thank you!

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I have cloned your solution. Can you share the steps to reproduce the error?

    Thanks

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    lba created
    • On branch abp-version-updates, do abp update -v 9.3.0
    • Update Blazorise Packages to 1.8.8
    • Update Microsoft.Extensions.FileProviders.Embedded to 9.0.5
    • Update Volo.Abp.AspNetCore.Components.Server.LeptonTheme from net8.0 to net9.0
    • Update Volo.Abp.AspNetCore.Components.Web.LeptonTheme from net8.0 to net9.0
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Hi,

    I've investigated the issue and found the root cause.

    The error System.ArgumentException: The path in 'value' must start with '/' is a bug in the Volo.Abp.AuditLogging.Blazor.Server package (version 9.3.0). In AuditLoggingScriptBundleContributor.cs, the export.js bundle path was registered without a leading /:

    // correct (existing)
    context.Files.AddIfNotContains("/_content/Volo.Abp.AuditLogging.Blazor/libs/chart/chart.min.js");
    // bug — missing leading '/'
    context.Files.AddIfNotContains("_content/Volo.Abp.AuditLogging.Blazor/libs/excel/export.js");
    

    This was introduced in version **9.3.0 **and fixed in version 9.3.4.

    Solution 1: Upgrade to 9.3.4+ (Recommended)

    Update your ABP packages from 9.3.0 to 9.3.4 or later (latest is 9.3.7). The bug is already fixed in those versions.

    Also, please make sure to update all embedded Lepton theme source projects (Volo.Abp.AspNetCore.Components.Server.LeptonTheme, Volo.Abp.AspNetCore.Components.Web.LeptonTheme, Volo.Abp.LeptonTheme.Management.*, etc.) — their ABP package references and TargetFramework must match the main project. The abp update command only updates NuGet package references, not source-code project dependencies.

    Solution 2: Workaround without upgrading

    If you want to stay on 9.3.0, add the following workaround in your BlazorLeptonThemeScriptContributor.cs. Since this contributor runs last in the script bundle pipeline, it can fix the paths contributed by other modules:

    public override void ConfigureBundle(BundleConfigurationContext context)
    {
        context.Files.AddIfNotContains("/_content/Volo.Abp.AspNetCore.Components.Web.LeptonTheme/scripts/global.js");
    
        // Workaround: Fix bundle file paths missing leading '/' (ABP 9.3.0 ~ 9.3.3 bug)
        for (var i = 0; i < context.Files.Count; i++)
        {
            if (!context.Files[i].FileName.StartsWith("/"))
            {
                context.Files[i] = new BundleFile("/" + context.Files[i].FileName);
            }
        }
    }
    

    https://github.com/ipooxlba/omm/commit/beab44e

    Thanks.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    lba created

    Hi,

    that is very insightful. Thank you very much for the detailed explanation and for your time!

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    I'm glad you solved the problem. 👍

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 16, 2026, 14:50
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.