net.core "a path base can only be configured using iapplicationbuilder.usepathbase()"

Code Example - net.core "a path base can only be configured using iapplicationbuilder.usepathbase()"

                
                        // Cannot set path base via applicationUrl, must set it here using UsePathBase()

public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            app.UsePathBase("/{my application name}");
            app.Run(context =>
            {
                return context.Response.WriteAsync("Hello World!");
            });
        }