C#C
C#12mo ago
Angius

Aspire project won't run if `applicationUrl` given in `launchSettings.json`

Weirdest shit ever...
"profiles": {
  "Ogma3": {
    "commandName": "Project",
    "launchBrowser": true,
    "environmentVariables": {
      "ASPNETCORE_ENVIRONMENT": "Development"
    },
    "applicationUrl": "https://localhost:5001"
  }
}

and going to https://localhost:5001 results in endless loading until the request times out, but
"profiles": {
  "Ogma3": {
    "commandName": "Project",
    "launchBrowser": true,
    "environmentVariables": {
      "ASPNETCORE_ENVIRONMENT": "Development"
    }
  }
}

makes the link not show on Aspire dashboard, true, but manually going to https://localhost:5001 works just peachy...

My Aspire config if it matters:
var builder = DistributedApplication.CreateBuilder(args);

var sqlPassword = builder.AddParameter("postgres-password", secret: true);
var sqlUsername = builder.AddParameter("postgres-username", secret: true);

var database = builder
    .AddPostgres("postgres", sqlUsername, sqlPassword)
    .WithDataVolume()
    .WithLifetime(ContainerLifetime.Persistent)
    .WithPgWeb()
    .AddDatabase("ogma3-db");

builder
    .AddProject<Projects.Ogma3>("ogma3")
    .WithReference(database)
    .WaitFor(database);

builder.Build().Run();
Was this page helpful?