microsoft / microsoft/aspire

Dashboard does not shut down when running Java play framework application

Open
#6,715 0 comments 0 reactions 1 assignee Claimed by @danegsta View on GitHub
area-orchestrator
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

### 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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.