Skip to content

Conversation

@twsouthwick
Copy link
Contributor

This updates the site registration to attempt to find an existing http or https port in the configuration for the project to be used by Aspire. If they are not present, random ones will continue to be added to the resource.

This updates the site registration to attempt to find an existing http or https port in the configuration for the project to be used by Aspire. If they are not present, random ones will continue to be added to the resource.
@CZEMacLeod
Copy link
Owner

I've done some work in other branches which did look at launch settings, so I want to make sure we are not repeating functionality.
This should probably be added to both AddSiteProject and AddIISExpressProject extension methods.

@CZEMacLeod
Copy link
Owner

When using the launchSettings.json file - you should read the launch profiles and extract the first profile with command name = "IISExpress" and check the use64bit property to fill that in in the metadata.
Unfortunately, the Aspire.Hosting.LaunchProfile class is sealed and does not include this property.
It is a bit out of date and I didn't find it easy to merge changes yet - but my original attempt on the branch feature-iislaunchprofile
If parsing launchSettings, we should also probably pull in the environment variables there. Although we should probably match the behaviour of the standard project resource.

@twsouthwick
Copy link
Contributor Author

I've added it to the AddSiteProject and AddIISExpressProject pathways and grabbed the use64bit property from the launch profile. I don't think we should pull the env variables since the standard project resource doesn't do that.

@CZEMacLeod
Copy link
Owner

hmm. If you are using a specific launch profile, I kinda expected that the env vars would be used. That feels odd to me, but if a net 8+ project ref doesn't do it, then yes, we should probably copy suit.
Should we have the same overloads for selecting a specific launch profile, or ignoring them too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants