title: .NET Core 2.2 can't be published to Azure
body: <p>I have ASP.NET Core 2.2 project and it can be run locally successfully. But when I try to publish it to Azure I get an error:</p>
  
  <pre><code>Unhandled Exception: System.ArgumentException: The path must be absolute.
  Parameter name: root
     at Microsoft.Extensions.FileProviders.PhysicalFileProvider..ctor(String root, ExclusionFilters filters)
     at Tms.Core.Infrastructure.TmsFileProvider..ctor(IHostingEnvironment hostingEnvironment) in C:\Users\rover\Source\Repos\TMS\Libraries\Tms.Core\Infrastructure\TmsFileProvider.cs:line 23
     at Tms.WebApi.Startup.ConfigureServices(IServiceCollection services) in C:\Users\rover\Source\Repos\TMS\Web\Tms.WebApi\Startup.cs:line 222
  --- End of stack trace from previous location where exception was thrown ---
     at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
     at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
     at Microsoft.AspNetCore.Hosting.Internal.WebHost.Initialize()
     at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
     at Tms.WebApi.Program.Main(String[] args) in C:\Users\rover\Source\Repos\TMS\Web\Tms.WebApi\Program.cs:line 17
  </code></pre>
  
  <p>where Program class has the following code:</p>
  
  <pre><code>public class Program
  {
      public static void Main(string[] args)
      {
          CreateWebHostBuilder(args).Build().Run();
      }
  
      public static IWebHostBuilder CreateWebHostBuilder(string[] args) =&gt;
          WebHost.CreateDefaultBuilder(args)
              .UseStartup&lt;Startup&gt;();
  }
  </code></pre>
  
  <p>Startup <code>ConfigureServices</code> method:</p>
  
  <pre><code>        var provider = services.BuildServiceProvider();
          var hostingEnvironment = provider.GetRequiredService&lt;IHostingEnvironment&gt;();
          CommonHelper.DefaultFileProvider = new TmsFileProvider(hostingEnvironment);
  </code></pre>
  
  <p>where:</p>
  
  <pre><code>    public TmsFileProvider(IHostingEnvironment hostingEnvironment) 
          : base(File.Exists(hostingEnvironment.WebRootPath) ? Path.GetDirectoryName(hostingEnvironment.WebRootPath) : hostingEnvironment.WebRootPath)
      {
          var path = hostingEnvironment.ContentRootPath ?? string.Empty;
          if (File.Exists(path))
              path = Path.GetDirectoryName(path);
  
          BaseDirectory = path;
      }
  </code></pre>
  
  <p>(don't ask me about this code, it's not my code, I just have to use it)</p>
  
  <p>I confused, why Azure knows my local path <code>C:\Users\rover\Source\Repos\TMS\Web\Tms.WebApi\</code>, where it's described and how to solve problem with deploy?</p>