Add ERROR_SHARING_VIOLATION to retry list for IISDeployer.Start (#1147)
This commit is contained in:
parent
4eb2e41601
commit
05eb6a7f7c
|
|
@ -20,6 +20,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting
|
||||||
internal class IISApplication
|
internal class IISApplication
|
||||||
{
|
{
|
||||||
internal const int ERROR_OBJECT_NOT_FOUND = unchecked((int)0x800710D8);
|
internal const int ERROR_OBJECT_NOT_FOUND = unchecked((int)0x800710D8);
|
||||||
|
internal const int ERROR_SHARING_VIOLATION = unchecked((int)0x80070020);
|
||||||
|
|
||||||
private static readonly TimeSpan _timeout = TimeSpan.FromSeconds(10);
|
private static readonly TimeSpan _timeout = TimeSpan.FromSeconds(10);
|
||||||
private static readonly TimeSpan _retryDelay = TimeSpan.FromMilliseconds(200);
|
private static readonly TimeSpan _retryDelay = TimeSpan.FromMilliseconds(200);
|
||||||
|
|
@ -109,7 +110,10 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting
|
||||||
_logger.LogInformation($"Tried to start site, state: {state.ToString()}");
|
_logger.LogInformation($"Tried to start site, state: {state.ToString()}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex) when (ex is DllNotFoundException || (ex is COMException && ex.HResult == ERROR_OBJECT_NOT_FOUND) )
|
catch (Exception ex) when (
|
||||||
|
ex is DllNotFoundException ||
|
||||||
|
ex is COMException &&
|
||||||
|
(ex.HResult == ERROR_OBJECT_NOT_FOUND || ex.HResult == ERROR_SHARING_VIOLATION))
|
||||||
{
|
{
|
||||||
// Accessing the site.State property while the site
|
// Accessing the site.State property while the site
|
||||||
// is starting up returns the COMException
|
// is starting up returns the COMException
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue