Open Closed

Issue with ABP application deployed to IIS subfolder #4982


User avatar
1
christian@extranerds.com created

I am writing to request assistance with an issue I am experiencing with an application that I have deployed to IIS under a subfolder. Specifically, I am encountering problems with the application's routing configuration, which is causing the application to lose the subfolder and display incorrect paths when using HTML or Navigation Manager.

NavigationManager.NavigateTo($"/log-details/{input.Id}", forceLoad: false);

```     @if (!CurrentUser.IsAuthenticated)
        {
            &lta href=   "../Account/Login"   class="btn btn-primary mb-1"&gt
                @L["Login"]
            &lt/a&gt
        }

When I click on menu items, the routing works correctly and includes the subfolder (e.g., localhost/test/account/login), but when using HTML or Navigation Manager, the subfolder is lost, and the path becomes incorrect (e.g., localhost/account/login).

I suspect that this issue is related to the routing configuration not being correctly set up to handle subfolders. However, I am not sure how to resolve this problem.

Here is some information about my setup:

  • ABP Framework version: v7.0.1
  • UI type:Blazor
  • DB provider: EF Core

Thank you for your help.


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

    hi

    Can you try to remove /?

    NavigationManager.NavigateTo($"log-details/{input.Id}", forceLoad: false);
    
  • User Avatar
    0
    christian@extranerds.com created

    That seems to help, I also had to remove it from generated code by the template, like here

            private  async Task DownloadAsExcelAsync()
            {
                var token = (await AcquisitionsAccountsAppService.GetDownloadTokenAsync()).Token;
                NavigationManager.NavigateTo($"/api/app/acquisitions-accounts/as-excel-file?DownloadToken=        {token}&FilterText={Filter.FilterText}", forceLoad: true);
            }
    

    However, there are still some instances when it breaks. When I click Sign Out, it sends me to a page without the subfolder like this http://localhost/?page=%2FAccount%2F~%2FAccount%2FLogin

    Also, I still do not have a solution for

       @if (!CurrentUser.IsAuthenticated)
            {
                &lta href=   "../Account/Login"   class="btn btn-primary mb-1">
                    @L["Login"]
                </a>
            }
    

    I tried adding a button to with a click event

    NavigationManager.NavigateTo("Account/Login", forceLoad: false);

    but gives me a 404

    Any ideas?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    I will check all redirects in commercial modules.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you try to set base?

    MyCompanyName.MyProjectName.Blazor/wwwroot/index.html

Made with ❤️ on ABP v9.1.0-preview. Updated on December 05, 2024, 12:19