title: Error, Publishing the application on linux server
body: <p>I am trying to publish the application (blazor WebAssembly with individual authentication and asp.net core hosted) to a linux server, but it gives me an error,
  I tried to add a certificate and a few startup options, but it did not help.</p>
  <p><strong>Linux:</strong></p>
  <pre><code>at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure.TransportManager.BindAsync(EndPoint endPoint, ConnectionDelegate connectionDelegate, EndpointConfig endpointConfig)
           at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.&lt;&gt;c__DisplayClass29_0`1.&lt;&lt;StartAsync&gt;g__OnBind|0&gt;d.MoveNext()
        --- End of stack trace from previous location ---
           at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindEndpointAsync(ListenOptions endpoint, AddressBindContext context)
           --- End of inner exception stack trace ---
           at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindEndpointAsync(ListenOptions endpoint, AddressBindContext context)
           at Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions.BindAsync(AddressBindContext context)
           at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.AddressesStrategy.BindAsync(AddressBindContext context)
           at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindAsync(IEnumerable`1 listenOptions, AddressBindContext context)
           at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.BindAsync(CancellationToken cancellationToken)
           at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.StartAsync[TContext](IHttpApplication`1 application, CancellationToken cancellationToken)
  Unhandled exception. System.IO.IOException: Failed to bind to address http://10.0.2.200:443: address already in use.
   ---&gt; Microsoft.AspNetCore.Connections.AddressInUseException: Address already in use
   ---&gt; System.Net.Sockets.SocketException (98): Address already in use
     at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName)
     at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
     at System.Net.Sockets.Socket.Bind(EndPoint localEP)
     at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketConnectionListener.&lt;Bind&gt;g__BindSocket|13_0(&lt;&gt;c__DisplayClass13_0&amp; )
     --- End of inner exception stack trace ---
     at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketConnectionListener.&lt;Bind&gt;g__BindSocket|13_0(&lt;&gt;c__DisplayClass13_0&amp; )
     at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketConnectionListener.Bind()
     at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketTransportFactory.BindAsync(EndPoint endpoint, CancellationToken cancellationToken)
     at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure.TransportManager.BindAsync(EndPoint endPoint, ConnectionDelegate connectionDelegate, EndpointConfig endpointConfig)
     at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.&lt;&gt;c__DisplayClass29_0`1.&lt;&lt;StartAsync&gt;g__OnBind|0&gt;d.MoveNext()
  --- End of stack trace from previous location ---
     at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindEndpointAsync(ListenOptions endpoint, AddressBindContext context)
     --- End of inner exception stack trace ---
     at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindEndpointAsync(ListenOptions endpoint, AddressBindContext context)
     at Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions.BindAsync(AddressBindContext context)
     at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.AddressesStrategy.BindAsync(AddressBindContext context)
     at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindAsync(IEnumerable`1 listenOptions, AddressBindContext context)
     at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.BindAsync(CancellationToken cancellationToken)
     at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.StartAsync[TContext](IHttpApplication`1 application, CancellationToken cancellationToken)
     at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
     at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
     at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
     at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
     at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
     at Polls.Server.Program.Main(String[] args) in C:\\.............Polls\Server\Program.cs:line 16
  </code></pre>
  <p><strong>startup.cs:</strong></p>
  <pre><code>public void ConfigureServices(IServiceCollection services)
          {
              
              services.AddDevExpressBlazor();
              services.AddDbContext&lt;ApplicationDbContext&gt;(options =&gt;
                  options.UseSqlServer(
                      Configuration.GetConnectionString(&quot;DefaultConnection&quot;)));
  
              services.AddDbContext&lt;AppDbContext&gt;(options =&gt;
                  options.UseSqlServer(
                      Configuration.GetConnectionString(&quot;PollsConnection&quot;)));
              services.AddTransient&lt;AppDbContext&gt;();
  
              //services.AddDbContext&lt;AppDbContext&gt;(options =&gt;
              //    options.UseSqlServer(
              //        Configuration.GetConnectionString(&quot;DefaultConnection&quot;)));
              //services.AddTransient&lt;AppDbContext&gt;();
  
              services.AddDatabaseDeveloperPageExceptionFilter();
  
              services.AddDefaultIdentity&lt;ApplicationUser&gt;(options =&gt; options.SignIn.RequireConfirmedAccount = false)
                  .AddEntityFrameworkStores&lt;ApplicationDbContext&gt;();
  
              services.AddIdentityServer()
                  .AddApiAuthorization&lt;ApplicationUser, ApplicationDbContext&gt;();
  
              services.AddAuthentication(CertificateAuthenticationDefaults.AuthenticationScheme)
                  .AddCertificate(options =&gt;
                   {
                       options.AllowedCertificateTypes = CertificateTypes.All;
                   })
                      .AddCertificateCache();
  
              services.AddAuthentication()
                  .AddIdentityServerJwt();
  
              ServicePointManager
              .ServerCertificateValidationCallback +=
              (sender, cert, chain, sslPolicyErrors) =&gt; true;
  
              var httpsSection = Configuration.GetSection(&quot;HttpServer:Endpoints:Https&quot;);
  
              services.AddHttpsRedirection(options =&gt;
              {
                  options.RedirectStatusCode = (int)HttpStatusCode.TemporaryRedirect;
                  options.HttpsPort = 443;
              });
  
              services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
                  .AddCookie(options =&gt;
                  {
                      options.CookieManager = new ChunkingCookieManager();
  
                      options.Cookie.HttpOnly = true;
                      options.Cookie.SameSite = SameSiteMode.None;
                      options.Cookie.SecurePolicy = CookieSecurePolicy.Always;
                  });
  
              services.AddControllersWithViews();
              services.AddRazorPages();
  
          }
  </code></pre>
  <p><strong>appsettings.json (certificate):</strong></p>
  <pre><code>&quot;Key&quot;: {
      &quot;Type&quot;: &quot;File&quot;,
      &quot;FilePath&quot;: &quot;/etc/ssl/private/certificate11.pfx&quot;,
      &quot;Password&quot;: &quot;12345&quot;,
      &quot;Name&quot;: &quot;/CN=private.key&quot;
    },
  </code></pre>
  <p><strong>appsettings.Development.json (certificate):</strong></p>
  <pre><code>&quot;HttpServer&quot;: {
      &quot;Endpoints&quot;: {
  
        &quot;Https&quot;: {
          &quot;Host&quot;: &quot;localhost&quot;,
          &quot;Port&quot;: 443,
          &quot;Scheme&quot;: &quot;https&quot;,
          &quot;FilePath&quot;: &quot;/etc/ssl/private/certificate11.pfx&quot;
        }
      }
    }
  </code></pre>
  <p><strong>Program.cs</strong></p>
  <pre><code>public class Program
      {
          public static void Main(string[] args)
          {
              CreateHostBuilder(args).Build().Run();
          }
  
          public static IHostBuilder CreateHostBuilder(string[] args) =&gt;
              Host.CreateDefaultBuilder(args)
                  .ConfigureWebHostDefaults(webBuilder =&gt;
                  {
                      webBuilder.UseStartup&lt;Startup&gt;();
                  });
      }
  </code></pre>