Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/Servers/IIS/IIS/src/Core/IISHttpServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ internal sealed class IISHttpServer : IServer
private readonly IISServerOptions _options;
private readonly IISNativeApplication _nativeApplication;
private readonly ServerAddressesFeature _serverAddressesFeature;
private readonly string? _virtualPath;
private string? _virtualPath;

private readonly TaskCompletionSource _shutdownSignal = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
private bool? _websocketAvailable;
Expand Down Expand Up @@ -69,8 +69,6 @@ ILogger<IISHttpServer> logger
_logger = logger;
_options = options.Value;
_serverAddressesFeature = new ServerAddressesFeature();
var iisConfigData = NativeMethods.HttpGetApplicationProperties();
_virtualPath = iisConfigData.pwzVirtualApplicationPath;

if (_options.ForwardWindowsAuthentication)
{
Expand Down Expand Up @@ -106,6 +104,9 @@ public unsafe Task StartAsync<TContext>(IHttpApplication<TContext> application,
(IntPtr)_httpServerHandle,
(IntPtr)_httpServerHandle);

var iisConfigData = NativeMethods.HttpGetApplicationProperties();
_virtualPath = iisConfigData.pwzVirtualApplicationPath;

_serverAddressesFeature.Addresses = _options.ServerAddresses;

return Task.CompletedTask;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public AppOfflineIISExpressTests(PublishedSitesFixture fixture) : base(fixture)
}

[ConditionalFact]
[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/60482")]
public async Task AppOfflineDroppedWhileSiteStarting_SiteShutsDown_InProcess()
{
// This test often hits a race between debug logging and stdout redirection closing the handle
Expand Down Expand Up @@ -55,8 +56,8 @@ public async Task AppOfflineDroppedWhileSiteStarting_SiteShutsDown_InProcess()
{
// For IISExpress, we need to catch the exception because IISExpress will not restart a process if it crashed.
// RemoveAppOffline will fail due to a bad request exception as the server is down.
Assert.Contains(TestSink.Writes, context => context.Message.Contains("Drained all requests, notifying managed."));
deploymentResult.AssertWorkerProcessStop();
Assert.Contains(TestSink.Writes, context => context.Message.Contains("Drained all requests, notifying managed."));
return;
}
}
Expand Down
Loading