Deploy .NET Core ServiceStack App as a virtual application in IIS

We deployed the .NET Core ServiceStack App as a virtual application in IIS.
The address is “https://mysite/api”.
The base app was developed using angular.
The problem is that the ‘/hello’ call result, which is a sample of the ServiceStack, is not what I want.

To run the .Net Core Virtual Application below the Angular site,
I added the web.config file to the angular site and applied the following URL Rewrite rules.

                <rule name="Web API rule" stopProcessing="true">
                    <match url="/api/.*" />
                    <action type="None" />
                <rule name="Angular rule">
                    <match url=".*" />
                        <conditions logicalGrouping="MatchAll">
                            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    <action type="Rewrite" url="/" />

If I call https://mysite/api/hello with [Route("/hello")], browser redirect to angular web site(root).
If I call https://mysite/api/api2/hello with [Route("/api2/hello")], browser redirect to angular web site(root).
If I call https://mysite/api/api/hello with [Route("/api/hello")], it’s working.

But in any case, there was no way to call /metadata.

Do I have to enter the Route attribute with ‘/api’, which is the path to the Virtual Application?
Can I set the path of the Virtual Application to Base url and let it run automatically?

I need a guide to add an Angular site to IIS and upload a ServiceStack to a Virtual Application.

The only supported option is to use the <location path="..."> element as demonstrated in Run side-by-side with another Framework docs:

  <!-- ... --> 
  <location path="api">
        <add path="*" type="ServiceStack.HttpHandlerFactory, ServiceStack" verb="*"/>

    <!-- Required for IIS 7.0 -->
      <modules runAllManagedModulesForAllRequests="true"/>
      <validation validateIntegratedModeConfiguration="false" />
        <add path="*" name="ServiceStack.Factory" 
             type="ServiceStack.HttpHandlerFactory, ServiceStack" 
             verb="*" preCondition="integratedMode" 
             resourceType="Unspecified" allowPathInfo="true" />
  <!-- ... --> 

Whatever path you put in the location should also be specified in Config.HandlerFactoryPath, e.g:

public override void Configure(Container container)
    SetConfig(new HostConfig { HandlerFactoryPath = "api" });

Sorry that’s only for ASP.NET, for .NET Core you should just be able to set the HandlerFactoryPath:

SetConfig(new HostConfig {
    HandlerFactoryPath = "api",

i.e. without any of the rewrite rules, then you should be able to access your APIs like: