title: Is it possible to run a DOTNET Core WebAPI asynchronously in an AvaloniaUI Project?
body: <p>I'm working on a project where I'm creating an AvaloniaUI frontend which would be able to be managed remotely via a REST API. In order to solve this, I created an Avalonia application, then added an additional project to the solution using the 'ASP.NET Core API' template.</p>
  <p>I used the following question as a template for setup:</p>
  <p><a href="https://stackoverflow.com/questions/60033762/hosting-asp-net-core-api-in-a-windows-forms-application">Hosting ASP.NET Core API in a Windows Forms Application</a></p>
  <p>Here they have a similar use case, however with a winforms project rather than Avalonia.</p>
  <p>Program.cs:</p>
  <p><a href="https://i.stack.imgur.com/miJcL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/miJcL.png" alt="enter image description here" /></a></p>
  <p>Startup.cs</p>
  <p><a href="https://i.stack.imgur.com/Bu2Nu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Bu2Nu.png" alt="enter image description here" /></a></p>
  <p>When the API project starts async, the server doesn't seem to be running as it refuses the connection. The only way I have been able to get it to respond to get requests has been to set the API project as the startup project (before I had made the changes to Program.cs).</p>
  <p>Any help at all will be appreciated, I'm relatively inexperienced when it comes to ASP.NET, so I apologise if this is a relatively simple issue.</p>