You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe the problem.
I have various 'accessory' projects in my solution that I would like to start/stop independently of my main API and Frontend services. Currently it seems that if these accessory projects are included in my Aspire AppHost, they're automatically started. I tried setting the initial snapshot state to Waiting, Stopped, Exiting, etc but the project is always started anyhow.
Describe the solution you'd like
It would be great if we could declare that the resource should not be started by default. This could be done via the snapshot state like I was trying, but ideally it should be a bit more straightforward to accomplish. Something that seems decent to me is to have a .WithLifecycle(ResourceLifecycle) extension on the IResourceBuilder that can be used to set how the resource is handled.
publicenumResourceLifecycle{AutoStart,DelayStart,// example for other use casesManualStart}publicstaticclassLifecycleExtensions{publicstaticIResourceBuilder<TResource>WithLifecycle<TResource>(thisIResourceBuilder<TResource>builder,ResourceLifecyclelifecycle)whereTResource:IResource{returnbuilder.WithAnnotation(newResourceLifecycleAnnotation(lifecycle));}}publicrecordclassResourceLifecycleAnnotation(ResourceLifecycleLifecycle):IResourceAnnotation{}// somewhere where the resources are being startedforeach(varexeinallExecutables){if(exe.TryGetLastAnnotation<ResourceLifecycleAnnotation>(outvarlifecycleAnnotation)){if(lifecycleAnnotation.Lifecycle==ResourceLifecycle.ManualStart)continue;// etc}}
Additional context
I realize that this can be hacked around with custom commands to run the projects manually, but it seems like a no brainer to me that some things on your dashboard might be optional or scenario dependent - and thus just shouldn't be started automatically.
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
I have various 'accessory' projects in my solution that I would like to start/stop independently of my main API and Frontend services. Currently it seems that if these accessory projects are included in my Aspire AppHost, they're automatically started. I tried setting the initial snapshot state to Waiting, Stopped, Exiting, etc but the project is always started anyhow.
Describe the solution you'd like
It would be great if we could declare that the resource should not be started by default. This could be done via the snapshot state like I was trying, but ideally it should be a bit more straightforward to accomplish. Something that seems decent to me is to have a
.WithLifecycle(ResourceLifecycle)
extension on theIResourceBuilder
that can be used to set how the resource is handled.Additional context
I realize that this can be hacked around with custom commands to run the projects manually, but it seems like a no brainer to me that some things on your dashboard might be optional or scenario dependent - and thus just shouldn't be started automatically.
The text was updated successfully, but these errors were encountered: