PathBase support in ASP.NET Core

Hi,

With regards to link generations (related to
Using GroupDocs in ASP.NET Core Linux Docker - Free Support Forum - groupdocs.com), when we use PathBase in ASP.NET Core, the PathBase value is not prepended in the generated link in index.html. This cause issue when loading the viewer.

@Bipo

I’ve reproduced this issue on my side. We’ll take a look at how it can be supported and update you.

@Bipo

This issue has been fixed. Try updating GroupDocs.Viewer.UI to 6.0.4.

<PackageReference Include="GroupDocs.Viewer.UI" Version="6.0.4" />

Hi Vladimir,

For runtime, polyfill and main.js files are OK now. But for config (and API?) endpoint still doesn’t have the PathBase. Can this be updated also?

Thank you.

@Bipo

Sure, we’ll let you know when PathBase is also supported for the API.

@Bipo

PathBase support has been added to API. Try updating GroupDocs.Viewer.UI to 6.0.5.

<PackageReference Include="GroupDocs.Viewer.UI" Version="6.0.5" />

Thank you Vladimir.

@Bipo

You’re welcome!

Hi @vladimir.litvinchik,

I’m using this thread again. I’m evaluating the latest version of GroupDocs version 8, but seems the Pathbase support is missing?
Can you help to check?

Thank you.

Screenshot 2025-05-21 181730.png (74.7 KB)

@Bipo

The issue should be fixed in the latest version of the package v8.0.6. As an example please check this two sample applications that intended to work togather:

In the UI part the key setting is at Program.cs#L31

options.ApiEndpoint = "https://localhost:5001/document-viewer-api";

And API part at Program.cs#L56-L57

options.ApiPath = "/document-viewer-api";
options.ApiDomain = "https://localhost:5001";

In case the domain is the same it can be omitted.

Please check with your config and let us know if it works.

Hi @vladimir.litvinchik,

The sample uses fixed route. But PathBase can be dynamic. For example:
https://localhost:5001/TenantA
https://localhost:5001/TenantB
https://localhost:5001/TenantC

If I see in the ApiUrlBuilder class, GetApiDomainOrDefault,
$“{request.Scheme}://{request.Host}”
I think after Host, should be followed with Request.PathBase. Similar to UIEndpointsResourceMapper.

Can you check?
Thank you.

@Bipo

Thank you for pointing out the actual problem. This issue has been fixed in the latest version of the GroupDocs.Viewer.UI packages (8.0.7).

Please let us know if you encounter any other issues or have any suggestions.

Have a nice day!