diff --git a/IISIntegration.NoV1.sln b/IISIntegration.NoV1.sln
index c2bd1b9ade..04bda53889 100644
--- a/IISIntegration.NoV1.sln
+++ b/IISIntegration.NoV1.sln
@@ -49,7 +49,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{7E80C58E
build\testsite.props = build\testsite.props
EndProjectSection
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IISIntegration.FunctionalTests", "test\IISIntegration.FunctionalTests\IISIntegration.FunctionalTests.csproj", "{4E3E1F5C-CD52-4CC0-A35F-D1FA1685D2FA}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IISExpress.FunctionalTests", "test\IISExpress.FunctionalTests\IISExpress.FunctionalTests.csproj", "{4E3E1F5C-CD52-4CC0-A35F-D1FA1685D2FA}"
ProjectSection(ProjectDependencies) = postProject
{7F87406C-A3C8-4139-A68D-E4C344294A67} = {7F87406C-A3C8-4139-A68D-E4C344294A67}
EndProjectSection
@@ -109,6 +109,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest", "test\gtest\gtest.v
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RequestHandlerLib", "src\AspNetCoreModuleV2\RequestHandlerLib\RequestHandlerLib.vcxproj", "{1533E271-F61B-441B-8B74-59FB61DF0552}"
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IIS.FunctionalTests", "test\IIS.FunctionalTests\IIS.FunctionalTests.csproj", "{D182103F-8405-4647-B158-C36F598657EF}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -353,6 +355,18 @@ Global
{1533E271-F61B-441B-8B74-59FB61DF0552}.Release|x64.Build.0 = Release|x64
{1533E271-F61B-441B-8B74-59FB61DF0552}.Release|x86.ActiveCfg = Release|Win32
{1533E271-F61B-441B-8B74-59FB61DF0552}.Release|x86.Build.0 = Release|Win32
+ {D182103F-8405-4647-B158-C36F598657EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D182103F-8405-4647-B158-C36F598657EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D182103F-8405-4647-B158-C36F598657EF}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {D182103F-8405-4647-B158-C36F598657EF}.Debug|x64.Build.0 = Debug|Any CPU
+ {D182103F-8405-4647-B158-C36F598657EF}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {D182103F-8405-4647-B158-C36F598657EF}.Debug|x86.Build.0 = Debug|Any CPU
+ {D182103F-8405-4647-B158-C36F598657EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D182103F-8405-4647-B158-C36F598657EF}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D182103F-8405-4647-B158-C36F598657EF}.Release|x64.ActiveCfg = Release|Any CPU
+ {D182103F-8405-4647-B158-C36F598657EF}.Release|x64.Build.0 = Release|Any CPU
+ {D182103F-8405-4647-B158-C36F598657EF}.Release|x86.ActiveCfg = Release|Any CPU
+ {D182103F-8405-4647-B158-C36F598657EF}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -381,6 +395,7 @@ Global
{340C59FC-C682-4CBA-81F8-791821EC8EDE} = {744ACDC6-F6A0-4FF9-9421-F25C5F2DC520}
{CAC1267B-8778-4257-AAC6-CAF481723B01} = {EF30B533-D715-421A-92B7-92FEF460AC9C}
{1533E271-F61B-441B-8B74-59FB61DF0552} = {06CA2C2B-83B0-4D83-905A-E0C74790009E}
+ {D182103F-8405-4647-B158-C36F598657EF} = {EF30B533-D715-421A-92B7-92FEF460AC9C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DB4F868D-E1AE-4FD7-9333-69FA15B268C5}
diff --git a/IISIntegration.sln b/IISIntegration.sln
index 86393ab4b7..d3e7ca4de0 100644
--- a/IISIntegration.sln
+++ b/IISIntegration.sln
@@ -49,7 +49,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{7E80C58E
build\testsite.props = build\testsite.props
EndProjectSection
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IISIntegration.FunctionalTests", "test\IISIntegration.FunctionalTests\IISIntegration.FunctionalTests.csproj", "{4E3E1F5C-CD52-4CC0-A35F-D1FA1685D2FA}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IISExpress.FunctionalTests", "test\IISExpress.FunctionalTests\IISExpress.FunctionalTests.csproj", "{4E3E1F5C-CD52-4CC0-A35F-D1FA1685D2FA}"
ProjectSection(ProjectDependencies) = postProject
{7F87406C-A3C8-4139-A68D-E4C344294A67} = {7F87406C-A3C8-4139-A68D-E4C344294A67}
EndProjectSection
@@ -116,6 +116,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest", "test\gtest\gtest.v
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RequestHandlerLib", "src\AspNetCoreModuleV2\RequestHandlerLib\RequestHandlerLib.vcxproj", "{1533E271-F61B-441B-8B74-59FB61DF0552}"
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IIS.FunctionalTests", "test\IIS.FunctionalTests\IIS.FunctionalTests.csproj", "{1F0C8D9B-F47B-41F3-9FC9-6954B6DC7712}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -380,6 +382,18 @@ Global
{1533E271-F61B-441B-8B74-59FB61DF0552}.Release|x64.Build.0 = Release|x64
{1533E271-F61B-441B-8B74-59FB61DF0552}.Release|x86.ActiveCfg = Release|Win32
{1533E271-F61B-441B-8B74-59FB61DF0552}.Release|x86.Build.0 = Release|Win32
+ {1F0C8D9B-F47B-41F3-9FC9-6954B6DC7712}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1F0C8D9B-F47B-41F3-9FC9-6954B6DC7712}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1F0C8D9B-F47B-41F3-9FC9-6954B6DC7712}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {1F0C8D9B-F47B-41F3-9FC9-6954B6DC7712}.Debug|x64.Build.0 = Debug|Any CPU
+ {1F0C8D9B-F47B-41F3-9FC9-6954B6DC7712}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {1F0C8D9B-F47B-41F3-9FC9-6954B6DC7712}.Debug|x86.Build.0 = Debug|Any CPU
+ {1F0C8D9B-F47B-41F3-9FC9-6954B6DC7712}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1F0C8D9B-F47B-41F3-9FC9-6954B6DC7712}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1F0C8D9B-F47B-41F3-9FC9-6954B6DC7712}.Release|x64.ActiveCfg = Release|Any CPU
+ {1F0C8D9B-F47B-41F3-9FC9-6954B6DC7712}.Release|x64.Build.0 = Release|Any CPU
+ {1F0C8D9B-F47B-41F3-9FC9-6954B6DC7712}.Release|x86.ActiveCfg = Release|Any CPU
+ {1F0C8D9B-F47B-41F3-9FC9-6954B6DC7712}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -411,6 +425,7 @@ Global
{340C59FC-C682-4CBA-81F8-791821EC8EDE} = {744ACDC6-F6A0-4FF9-9421-F25C5F2DC520}
{CAC1267B-8778-4257-AAC6-CAF481723B01} = {EF30B533-D715-421A-92B7-92FEF460AC9C}
{1533E271-F61B-441B-8B74-59FB61DF0552} = {06CA2C2B-83B0-4D83-905A-E0C74790009E}
+ {1F0C8D9B-F47B-41F3-9FC9-6954B6DC7712} = {EF30B533-D715-421A-92B7-92FEF460AC9C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DB4F868D-E1AE-4FD7-9333-69FA15B268C5}
diff --git a/benchmarks/IIS.Performance/IIS.Performance.csproj b/benchmarks/IIS.Performance/IIS.Performance.csproj
index 179e042514..87102ca7ed 100644
--- a/benchmarks/IIS.Performance/IIS.Performance.csproj
+++ b/benchmarks/IIS.Performance/IIS.Performance.csproj
@@ -12,7 +12,7 @@
-
+
@@ -24,7 +24,7 @@
-
+
False
diff --git a/benchmarks/IIS.Performance/StartupTimeBenchmark.cs b/benchmarks/IIS.Performance/StartupTimeBenchmark.cs
index 4e16e33b49..ef66b6b671 100644
--- a/benchmarks/IIS.Performance/StartupTimeBenchmark.cs
+++ b/benchmarks/IIS.Performance/StartupTimeBenchmark.cs
@@ -25,7 +25,7 @@ namespace Microsoft.AspNetCore.Server.IIS.Performance
RuntimeFlavor.CoreClr,
RuntimeArchitecture.x64)
{
- ServerConfigTemplateContent = File.ReadAllText("Http.config"),
+ ServerConfigTemplateContent = File.ReadAllText("IISExpress.config"),
SiteName = "HttpTestSite",
TargetFramework = "netcoreapp2.1",
ApplicationType = ApplicationType.Portable,
diff --git a/build/repo.props b/build/repo.props
index 68acab72ce..1323b23e8d 100644
--- a/build/repo.props
+++ b/build/repo.props
@@ -9,11 +9,6 @@
-
-
-
-
-
diff --git a/src/AspNetCoreModuleV2/AspNetCore/src/applicationinfo.cpp b/src/AspNetCoreModuleV2/AspNetCore/src/applicationinfo.cpp
index b1bcc464c3..99251ddc4a 100644
--- a/src/AspNetCoreModuleV2/AspNetCore/src/applicationinfo.cpp
+++ b/src/AspNetCoreModuleV2/AspNetCore/src/applicationinfo.cpp
@@ -187,12 +187,6 @@ APPLICATION_INFO::EnsureApplicationCreated(
// one optimization for failure scenario is to reduce the lock scope
SRWExclusiveLock lock(m_srwLock);
- if (m_fDoneAppCreation)
- {
- // application is NULL and CreateApplication failed previously
- FINISHED(E_APPLICATION_ACTIVATION_EXEC_FAILURE);
- }
- else
{
if (m_pApplication != NULL)
{
diff --git a/src/Microsoft.AspNetCore.Server.IIS/Core/IISHttpContext.FeatureCollection.cs b/src/Microsoft.AspNetCore.Server.IIS/Core/IISHttpContext.FeatureCollection.cs
index 05c376de0e..4c2d4342b9 100644
--- a/src/Microsoft.AspNetCore.Server.IIS/Core/IISHttpContext.FeatureCollection.cs
+++ b/src/Microsoft.AspNetCore.Server.IIS/Core/IISHttpContext.FeatureCollection.cs
@@ -182,7 +182,7 @@ namespace Microsoft.AspNetCore.Server.IIS.Core
bool IHttpResponseFeature.HasStarted => HasResponseStarted;
- bool IHttpUpgradeFeature.IsUpgradableRequest => _server.IsWebSocketAvailable(_pInProcessHandler);
+ bool IHttpUpgradeFeature.IsUpgradableRequest => true;
bool IFeatureCollection.IsReadOnly => false;
@@ -205,7 +205,11 @@ namespace Microsoft.AspNetCore.Server.IIS.Core
return null;
}
- return NativeMethods.HttpTryGetServerVariable(_pInProcessHandler, variableName, out var value) ? value : null;
+ // Synchronize access to native methods that might run in parallel with IO loops
+ lock (_contextLock)
+ {
+ return NativeMethods.HttpTryGetServerVariable(_pInProcessHandler, variableName, out var value) ? value : null;
+ }
}
}
@@ -265,7 +269,7 @@ namespace Microsoft.AspNetCore.Server.IIS.Core
_hasRequestReadingStarted = false;
// Upgrade async will cause the stream processing to go into duplex mode
- AsyncIO = new WebSocketsAsyncIOEngine(_pInProcessHandler);
+ AsyncIO = new WebSocketsAsyncIOEngine(_contextLock, _pInProcessHandler);
await InitializeResponse(flushHeaders: true);
diff --git a/src/Microsoft.AspNetCore.Server.IIS/Core/IISHttpContext.cs b/src/Microsoft.AspNetCore.Server.IIS/Core/IISHttpContext.cs
index 1866967527..15c69432ed 100644
--- a/src/Microsoft.AspNetCore.Server.IIS/Core/IISHttpContext.cs
+++ b/src/Microsoft.AspNetCore.Server.IIS/Core/IISHttpContext.cs
@@ -28,7 +28,6 @@ namespace Microsoft.AspNetCore.Server.IIS.Core
private const int PauseWriterThreshold = 65536;
private const int ResumeWriterTheshold = PauseWriterThreshold / 2;
-
protected readonly IntPtr _pInProcessHandler;
private readonly IISServerOptions _options;
@@ -38,8 +37,8 @@ namespace Microsoft.AspNetCore.Server.IIS.Core
private int _statusCode;
private string _reasonPhrase;
- private readonly object _onStartingSync = new object();
- private readonly object _onCompletedSync = new object();
+ // Used to synchronize callback registration and native method calls
+ private readonly object _contextLock = new object();
protected Stack, object>> _onStarting;
protected Stack, object>> _onCompleted;
@@ -241,7 +240,7 @@ namespace Microsoft.AspNetCore.Server.IIS.Core
// If at this point request was not upgraded just start a normal IO engine
if (AsyncIO == null)
{
- AsyncIO = new AsyncIOEngine(_pInProcessHandler);
+ AsyncIO = new AsyncIOEngine(_contextLock, _pInProcessHandler);
}
}
@@ -341,7 +340,7 @@ namespace Microsoft.AspNetCore.Server.IIS.Core
public void OnStarting(Func