Starts in:
0 DAY
19 HRS
32 MIN
1 SEC
Starts in:
0 D
19 H
32 M
1 S
Open Closed

Issue with WebRootPath being null in AbpMvcLibsService (An error occurred while checking the libs folder!) #7954


User avatar
0
mert.kir created
  • ABP Framework version: v8.3
  • UI Type: Angular
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:

An error occurred while checking the libs folder! System.ArgumentException: The path must be absolute. (Parameter 'root') at Microsoft.Extensions.FileProviders.PhysicalFileProvider..ctor(String root, ExclusionFilters filters) at Volo.Abp.AspNetCore.Mvc.Libs.AbpMvcLibsService.CheckLibsAsync(HttpContext httpContext)

  • Steps to reproduce the issue:
  • In Abp version 8.3, a new project is created and the HttpApi.Host project is run and the console logs are examined at that time.
  • It is seen that the Swagger page has arrived, but there is also an error in the console logs

I am encountering an issue in the AbpMvcLibsService class where httpContext.RequestServices.GetRequiredService<IWebHostEnvironment>().WebRootPath returns null. This causes an error as the PhysicalFileProvider class does not accept null values.

As a temporary workaround, I created a wwwroot directory in the folder structure of the HttpApi.Host project. Inside this directory, I added a libs folder and created a dummy file within it. This resolves the issue temporarily, but I would appreciate your assistance in addressing the root cause of this problem and finding a proper solution.

Thank you for your support!


2 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    We fixed the problem, and it will included in the next patch version.

    https://github.com/abpframework/abp/commit/544e24d85fc2d0f5da987f1a2607323ec4fb7a84

    you can try disabled for now

    Configure<AbpMvcLibsOptions>(options =>{
    
        options.CheckLibs = false;
    
    });
    
  • User Avatar
    0
    mert.kir created

    Hi,

    We fixed the problem, and it will included in the next patch version.

    https://github.com/abpframework/abp/commit/544e24d85fc2d0f5da987f1a2607323ec4fb7a84

    you can try disabled for now

    Configure<AbpMvcLibsOptions>(options =>{ 
     
        options.CheckLibs = false; 
     
    }); 
    

    hi

    thanks for the reply, for now my problem is solved with this method.

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06