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
Today when you call aspire publish, it calls dotnet run on the AppHost project without specifying a launch profile. This means that the first launch profile in launchSettings.json is used to execute the AppHost for publishing.
This is a problem because the first launch profile is meant for F5 / local run mode.
Specifically the issue is that "DOTNET_ENVIRONMENT": "Development", is set, which means the AppHost is run with builder.Environment.IsDevelopment() == true. This is the wrong default for aspire publish. Instead when you aspire publish, it should be using the Production environment by default.
We should consider how launch profiles work all up with aspire publish. One strategy we could take:
Allow the launch profile to be specified via aspire publish. If it is supplied, use it. This allows for multiple publish profiles to be set in launchSettings.json.
Have a "default" publish launch profile, for example one named publish. If it is found, use it.
Run the AppHost with --no-launch-profile if none of the above 2 are true.
Or we could decide that launch profiles don't make sense at all during aspire publish, and always specify --no-launch-profile. But since we are running the AppHost project, it does feel natural to consider a "launch profile".
I think they don’t make much sense for publish but we do want to give people control. Maybe that means a cli arg that maps to ASPIRE_ENVIRONMENT which sets the env appropriately
I think they don’t make much sense for publish but we do want to give people control. Maybe that means a cli arg that maps to ASPIRE_ENVIRONMENT which sets the env appropriately
I think starting from this (a CLI arg for setting environment) plus passing --no-launch-profile to the app host when running it in publish mode is a reasonable start. We can then look at how folks are using the CLI arg to decide whether it's worthwhile supporting an actual launch profile as part of the publish execution.
Today when you call
aspire publish
, it callsdotnet run
on the AppHost project without specifying a launch profile. This means that the first launch profile inlaunchSettings.json
is used to execute the AppHost for publishing.This is a problem because the first launch profile is meant for
F5
/ local run mode.aspire/src/Aspire.ProjectTemplates/templates/aspire-starter/9.2/Aspire-StarterApplication.1.AppHost/Properties/launchSettings.json
Lines 3 to 16 in 8fd92af
Specifically the issue is that
"DOTNET_ENVIRONMENT": "Development",
is set, which means the AppHost is run withbuilder.Environment.IsDevelopment() == true
. This is the wrong default foraspire publish
. Instead when youaspire publish
, it should be using theProduction
environment by default.We should consider how launch profiles work all up with
aspire publish
. One strategy we could take:aspire publish
. If it is supplied, use it. This allows for multiple publish profiles to be set in launchSettings.json.publish
. If it is found, use it.--no-launch-profile
if none of the above 2 are true.Or we could decide that launch profiles don't make sense at all during
aspire publish
, and always specify--no-launch-profile
. But since we are running the AppHost project, it does feel natural to consider a "launch profile".cc @mitchdenny @DamianEdwards @davidfowl
The text was updated successfully, but these errors were encountered: