I have three dotnet solutions (and not projects) and each of them is made of a bunch of dotnet projects. I want to encapsulate them in a single Dotnet Aspire solution.
Any idea how to do that?
Yes. (Tested)
AppHost is project centric, not solution centric. I integrated project from completely different repo (and thus solution).
Aspire AppHost is ProjectReference based meaning it should work after you add ProjectReferences to Aspire AppHost csproj.
Then you should find generated code for your projects in obj\$(CONFIGURATION)\$(TARGETFRAMEWORK)\Aspire
I do that by using Aspire's AddExecutable(...) in my AppHost to reference executables built by other solutions.
Here's an example:
var tenantServiceCommand = Path.GetFullPath("../../../tenant/src/TenantService/bin/Debug/net8.0/TenantService.exe");
var tenantServiceWorkingDirectory = Path.GetFullPath("../../../tenant/src/TenantService/bin/Debug/net8.0/");
var tenantService = builder.AddExecutable("tenantService", tenantServiceCommand, tenantServiceWorkingDirectory)
.WithEndpoint(8020, "https", "tsEndpoint", "ASPNETCORE_HTTPS_PORTS");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With