Skip to content

Conversation

@twsouthwick
Copy link
Member

@twsouthwick twsouthwick commented Aug 16, 2023

Adds IIISEnvironmentFeature to expose IIS hosting details. This makes the following changes:

  • Updates aspnetcorev2.dll to set environment variables for IIS values we need
  • Surfaces IIISEnvironmentFeature via IServer.Features on IIS if the values are available

Fixes #43632

@ghost ghost added the area-runtime label Aug 16, 2023
@twsouthwick twsouthwick marked this pull request as ready for review August 18, 2023 17:37
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 25, 2023
@Tratcher
Copy link
Member

@adityamandaleeka, @BrennanConroy, can you check the native code and merge?

Copy link
Member

@BrennanConroy BrennanConroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a test?
This looks similar to what we would add:

public async Task HostingEnvironmentIsCorrect()

Copy link
Member

@BrennanConroy BrennanConroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the test 👍
Now you just need to make it work for both IISExpress and IIS 😉

@adityamandaleeka
Copy link
Member

Native parts look fine to me. Maybe a bit too much auto but I'll live... 😆

@twsouthwick
Copy link
Member Author

@BrennanConroy got it working for both IISExpress and IIS. Had to surface some data from the deployer to be able to test the resulting values

@adityamandaleeka I've replaced auto with the types - no preference on my side, so I'll go with yours :)

@adityamandaleeka
Copy link
Member

Thanks @twsouthwick

@twsouthwick twsouthwick merged commit 2dc9913 into dotnet:main Aug 30, 2023
@twsouthwick twsouthwick deleted the iis_app_feature branch August 30, 2023 21:14
@ghost ghost added this to the 9.0-preview1 milestone Aug 30, 2023
@twsouthwick
Copy link
Member Author

/backport to release/8.0

@ghost
Copy link

ghost commented Aug 30, 2023

Hi @twsouthwick. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context.

@github-actions
Copy link
Contributor

Started backporting to release/8.0: https://github.com/dotnet/aspnetcore/actions/runs/6030166080

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

Labels

area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add equivalent of HttpRuntime.AppDomainAppId available at all times when hosted in IIS

5 participants