Skip to content

Commit 76b4df0

Browse files
Update IISHttpServer.cs
1 parent 58ac2f7 commit 76b4df0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Servers/IIS/IIS/src/Core/IISHttpServer.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ internal sealed class IISHttpServer : IServer
2828
private readonly IISServerOptions _options;
2929
private readonly IISNativeApplication _nativeApplication;
3030
private readonly ServerAddressesFeature _serverAddressesFeature;
31-
private readonly string? _virtualPath;
31+
private string? _virtualPath;
3232

3333
private readonly TaskCompletionSource _shutdownSignal = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
3434
private bool? _websocketAvailable;
@@ -69,8 +69,6 @@ ILogger<IISHttpServer> logger
6969
_logger = logger;
7070
_options = options.Value;
7171
_serverAddressesFeature = new ServerAddressesFeature();
72-
var iisConfigData = NativeMethods.HttpGetApplicationProperties();
73-
_virtualPath = iisConfigData.pwzVirtualApplicationPath;
7472

7573
if (_options.ForwardWindowsAuthentication)
7674
{
@@ -106,6 +104,9 @@ public unsafe Task StartAsync<TContext>(IHttpApplication<TContext> application,
106104
(IntPtr)_httpServerHandle,
107105
(IntPtr)_httpServerHandle);
108106

107+
var iisConfigData = NativeMethods.HttpGetApplicationProperties();
108+
_virtualPath = iisConfigData.pwzVirtualApplicationPath;
109+
109110
_serverAddressesFeature.Addresses = _options.ServerAddresses;
110111

111112
return Task.CompletedTask;

0 commit comments

Comments
 (0)