dotnet / aspire

Tools, templates, and packages to accelerate building observable, production-ready apps
https://learn.microsoft.com/dotnet/aspire
MIT License
3.91k stars 475 forks source link

Dashboard does not shut down when running Java play framework application #6715

Open davidfowl opened 3 days ago

davidfowl commented 3 days ago

Discussed in https://github.com/dotnet/aspire/discussions/6672

Originally posted by **schmitch** November 14, 2024 Hello I have a scala application that I want to run with `dotnet/aspire` it's a playframework application, however when I try to run it it crashes the aspire dashboard and it does not work: ``` var builder = DistributedApplication.CreateBuilder(args); var baseDirectory = Directory.GetParent(builder.AppHostDirectory)?.FullName; ArgumentException.ThrowIfNullOrEmpty(baseDirectory); Console.WriteLine($"Using {baseDirectory} as a base path"); var isWin = RuntimeInformation.IsOSPlatform(OSPlatform.Windows); var isMac = RuntimeInformation.IsOSPlatform(OSPlatform.OSX); builder .AddExecutable("scala-web", "sbt", baseDirectory, args: ["run", "-Dplay.server.http.port=9001", "-Dsbt.server.autostart=false"]); builder.Build().Run(); ``` ``` Exe enable enable true ``` What might be problematic is that sbt starts in a reloading mode, i.e. something like `dotnet watch`. After the run I press Ctrl+C however aspire dashboard keeps running besides that it does not work anymore and I cant rerun it. the dashboard can be accessed shortly after starting and it also prints that it starts playframework however it does not print everything and than the log just hangs and nothing works. if I use: ``` var process = new Process { StartInfo = new ProcessStartInfo { WorkingDirectory = baseDirectory, FileName = "sbt", UseShellExecute = true, Arguments = "run -Dplay.server.http.port=9001 -Dsbt.server.autostart=false", } }; process.Start(); ``` basically everthing works. Is there something I'm missing?