diff --git a/IISIntegration.sln b/IISIntegration.sln
index 4e13400b18..75d59c5d46 100644
--- a/IISIntegration.sln
+++ b/IISIntegration.sln
@@ -39,8 +39,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{7E80C58E
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IISIntegration.FunctionalTests", "test\IISIntegration.FunctionalTests\IISIntegration.FunctionalTests.csproj", "{4E3E1F5C-CD52-4CC0-A35F-D1FA1685D2FA}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Server.IIS", "src\Microsoft.AspNetCore.Server.IIS\Microsoft.AspNetCore.Server.IIS.csproj", "{5C475A6A-8FF6-401F-A35E-01461312C8F6}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NativeIISSample", "samples\NativeIISSample\NativeIISSample.csproj", "{9BC4AFCB-325D-4C81-8228-8CF301CE2F97}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IISTestSite", "test\IISTestSite\IISTestSite.csproj", "{679FA2A2-898B-4320-884E-C2D294A97CE1}"
@@ -117,18 +115,6 @@ Global
{4E3E1F5C-CD52-4CC0-A35F-D1FA1685D2FA}.Release|x64.Build.0 = Release|Any CPU
{4E3E1F5C-CD52-4CC0-A35F-D1FA1685D2FA}.Release|x86.ActiveCfg = Release|Any CPU
{4E3E1F5C-CD52-4CC0-A35F-D1FA1685D2FA}.Release|x86.Build.0 = Release|Any CPU
- {5C475A6A-8FF6-401F-A35E-01461312C8F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {5C475A6A-8FF6-401F-A35E-01461312C8F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {5C475A6A-8FF6-401F-A35E-01461312C8F6}.Debug|x64.ActiveCfg = Debug|Any CPU
- {5C475A6A-8FF6-401F-A35E-01461312C8F6}.Debug|x64.Build.0 = Debug|Any CPU
- {5C475A6A-8FF6-401F-A35E-01461312C8F6}.Debug|x86.ActiveCfg = Debug|Any CPU
- {5C475A6A-8FF6-401F-A35E-01461312C8F6}.Debug|x86.Build.0 = Debug|Any CPU
- {5C475A6A-8FF6-401F-A35E-01461312C8F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {5C475A6A-8FF6-401F-A35E-01461312C8F6}.Release|Any CPU.Build.0 = Release|Any CPU
- {5C475A6A-8FF6-401F-A35E-01461312C8F6}.Release|x64.ActiveCfg = Release|Any CPU
- {5C475A6A-8FF6-401F-A35E-01461312C8F6}.Release|x64.Build.0 = Release|Any CPU
- {5C475A6A-8FF6-401F-A35E-01461312C8F6}.Release|x86.ActiveCfg = Release|Any CPU
- {5C475A6A-8FF6-401F-A35E-01461312C8F6}.Release|x86.Build.0 = Release|Any CPU
{9BC4AFCB-325D-4C81-8228-8CF301CE2F97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9BC4AFCB-325D-4C81-8228-8CF301CE2F97}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9BC4AFCB-325D-4C81-8228-8CF301CE2F97}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -174,7 +160,6 @@ Global
{4106DB10-E09F-480E-9CE6-B39235512EE6} = {EF30B533-D715-421A-92B7-92FEF460AC9C}
{F54715C3-88D8-49E3-A291-C13570FE81FC} = {EF30B533-D715-421A-92B7-92FEF460AC9C}
{4E3E1F5C-CD52-4CC0-A35F-D1FA1685D2FA} = {EF30B533-D715-421A-92B7-92FEF460AC9C}
- {5C475A6A-8FF6-401F-A35E-01461312C8F6} = {04B1EDB6-E967-4D25-89B9-E6F8304038CD}
{9BC4AFCB-325D-4C81-8228-8CF301CE2F97} = {C74B8F36-FD2F-45C9-9B8A-00E7CF0126A9}
{679FA2A2-898B-4320-884E-C2D294A97CE1} = {EF30B533-D715-421A-92B7-92FEF460AC9C}
{C745BBFD-7888-4038-B41B-6D1832D13878} = {EF30B533-D715-421A-92B7-92FEF460AC9C}
diff --git a/samples/NativeIISSample/NativeIISSample.csproj b/samples/NativeIISSample/NativeIISSample.csproj
index baa325ba85..04a53a5e88 100644
--- a/samples/NativeIISSample/NativeIISSample.csproj
+++ b/samples/NativeIISSample/NativeIISSample.csproj
@@ -3,6 +3,9 @@
netcoreapp2.0
-
+
+
+
+
diff --git a/samples/NativeIISSample/Startup.cs b/samples/NativeIISSample/Startup.cs
index 46fc4b2052..205992ea19 100644
--- a/samples/NativeIISSample/Startup.cs
+++ b/samples/NativeIISSample/Startup.cs
@@ -5,9 +5,6 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
-using Microsoft.AspNetCore.Server.IIS;
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.DependencyInjection;
namespace NativeIISSample
{
@@ -66,7 +63,7 @@ namespace NativeIISSample
public static void Main(string[] args)
{
var host = new WebHostBuilder()
- .UseNativeIIS()
+ .UseIISIntegration()
.UseStartup()
.Build();
diff --git a/samples/NativeIISSample/applicationhost.config b/samples/NativeIISSample/applicationhost.config
index c5b245729f..b11f212ef2 100644
--- a/samples/NativeIISSample/applicationhost.config
+++ b/samples/NativeIISSample/applicationhost.config
@@ -977,11 +977,6 @@
-
-
-
-
-
diff --git a/src/Microsoft.AspNetCore.Server.IIS/Microsoft.AspNetCore.Server.IIS.csproj b/src/Microsoft.AspNetCore.Server.IIS/Microsoft.AspNetCore.Server.IIS.csproj
deleted file mode 100644
index bfb4f82bcb..0000000000
--- a/src/Microsoft.AspNetCore.Server.IIS/Microsoft.AspNetCore.Server.IIS.csproj
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
- ASP.NET Core components for running the in process mode for AspNetCoreModule.
- netstandard2.0
- $(NoWarn);CS1591
- true
- aspnetcore;iis
- true
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/Microsoft.AspNetCore.Server.IIS/NativeMethods.cs b/src/Microsoft.AspNetCore.Server.IIS/NativeMethods.cs
deleted file mode 100644
index 79f2b3bfa7..0000000000
--- a/src/Microsoft.AspNetCore.Server.IIS/NativeMethods.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-using System;
-using System.Runtime.InteropServices;
-using Microsoft.AspNetCore.HttpSys.Internal;
-
-namespace Microsoft.AspNetCore.Server.IIS
-{
- public static class NativeMethods
- {
- public const int S_OK = 0;
- private const string AspNetCoreModuleDll = "aspnetcore.dll";
-
- public enum REQUEST_NOTIFICATION_STATUS
- {
- RQ_NOTIFICATION_CONTINUE,
- RQ_NOTIFICATION_PENDING,
- RQ_NOTIFICATION_FINISH_REQUEST
- }
-
- public delegate REQUEST_NOTIFICATION_STATUS PFN_REQUEST_HANDLER(IntPtr pHttpContext, IntPtr pvRequestContext);
- public delegate bool PFN_SHUTDOWN_HANDLER(IntPtr pvRequestContext);
- public delegate REQUEST_NOTIFICATION_STATUS PFN_ASYNC_COMPLETION(IntPtr pHttpContext, IntPtr completionInfo, IntPtr pvCompletionContext);
-
- // TODO make this all internal
- [DllImport(AspNetCoreModuleDll)]
- public static extern int http_post_completion(IntPtr pHttpContext, int cbBytes);
-
- [DllImport(AspNetCoreModuleDll)]
- public static extern void http_indicate_completion(IntPtr pHttpContext, REQUEST_NOTIFICATION_STATUS notificationStatus);
-
- [DllImport(AspNetCoreModuleDll)]
- public static extern void register_callbacks(PFN_REQUEST_HANDLER request_callback, PFN_SHUTDOWN_HANDLER shutdown_callback, IntPtr pvRequestContext, IntPtr pvShutdownContext);
-
- [DllImport(AspNetCoreModuleDll)]
- internal unsafe static extern int http_write_response_bytes(IntPtr pHttpContext, HttpApiTypes.HTTP_DATA_CHUNK* pDataChunks, int nChunks, PFN_ASYNC_COMPLETION pfnCompletionCallback, IntPtr pvCompletionContext, out bool fCompletionExpected);
-
- [DllImport(AspNetCoreModuleDll)]
- public unsafe static extern int http_flush_response_bytes(IntPtr pHttpContext, PFN_ASYNC_COMPLETION pfnCompletionCallback, IntPtr pvCompletionContext, out bool fCompletionExpected);
-
- [DllImport(AspNetCoreModuleDll)]
- internal unsafe static extern HttpApiTypes.HTTP_REQUEST_V2* http_get_raw_request(IntPtr pHttpContext);
-
- [DllImport(AspNetCoreModuleDll)]
- internal unsafe static extern HttpApiTypes.HTTP_RESPONSE_V2* http_get_raw_response(IntPtr pHttpContext);
-
- [DllImport(AspNetCoreModuleDll)]
- public unsafe static extern void http_set_response_status_code(IntPtr pHttpContext, ushort statusCode, byte* pszReason);
-
- [DllImport(AspNetCoreModuleDll)]
- public unsafe static extern int http_read_request_bytes(IntPtr pHttpContext, byte* pvBuffer, int cbBuffer, PFN_ASYNC_COMPLETION pfnCompletionCallback, IntPtr pvCompletionContext, out int dwBytesReceived, out bool fCompletionExpected);
-
- [DllImport(AspNetCoreModuleDll)]
- public unsafe static extern bool http_get_completion_info(IntPtr pCompletionInfo, out int cbBytes, out int hr);
-
- [DllImport(AspNetCoreModuleDll)]
- [return: MarshalAs(UnmanagedType.BStr)]
- public unsafe static extern string http_get_application_full_path();
-
- [DllImport(AspNetCoreModuleDll)]
- public unsafe static extern bool http_shutdown();
-
- [DllImport("kernel32.dll")]
- public static extern IntPtr GetModuleHandle(string lpModuleName);
-
- public static bool is_ancm_loaded()
- {
- return GetModuleHandle(AspNetCoreModuleDll) != IntPtr.Zero;
- }
- }
-}
diff --git a/src/Microsoft.AspNetCore.Server.IISIntegration/Microsoft.AspNetCore.Server.IISIntegration.csproj b/src/Microsoft.AspNetCore.Server.IISIntegration/Microsoft.AspNetCore.Server.IISIntegration.csproj
index 68cb73694a..2fece72fce 100644
--- a/src/Microsoft.AspNetCore.Server.IISIntegration/Microsoft.AspNetCore.Server.IISIntegration.csproj
+++ b/src/Microsoft.AspNetCore.Server.IISIntegration/Microsoft.AspNetCore.Server.IISIntegration.csproj
@@ -1,4 +1,4 @@
-
+
ASP.NET Core components for working with the IIS AspNetCoreModule.
@@ -6,18 +6,26 @@
$(NoWarn);CS1591
true
aspnetcore;iis
+ true
+
+
+
+
+
+
+
+
-
diff --git a/src/Microsoft.AspNetCore.Server.IISIntegration/NativeMethods.cs b/src/Microsoft.AspNetCore.Server.IISIntegration/NativeMethods.cs
index 8a49c2781c..86a932556c 100644
--- a/src/Microsoft.AspNetCore.Server.IISIntegration/NativeMethods.cs
+++ b/src/Microsoft.AspNetCore.Server.IISIntegration/NativeMethods.cs
@@ -3,6 +3,7 @@
using System;
using System.Runtime.InteropServices;
+using Microsoft.AspNetCore.HttpSys.Internal;
namespace Microsoft.AspNetCore.Server.IISIntegration
{
@@ -20,5 +21,65 @@ namespace Microsoft.AspNetCore.Server.IISIntegration
[DllImport(KERNEL32, ExactSpelling = true, SetLastError = true)]
#endif
internal static extern bool CloseHandle(IntPtr handle);
+
+ public const int S_OK = 0;
+ private const string AspNetCoreModuleDll = "aspnetcore.dll";
+
+ public enum REQUEST_NOTIFICATION_STATUS
+ {
+ RQ_NOTIFICATION_CONTINUE,
+ RQ_NOTIFICATION_PENDING,
+ RQ_NOTIFICATION_FINISH_REQUEST
+ }
+
+ public delegate REQUEST_NOTIFICATION_STATUS PFN_REQUEST_HANDLER(IntPtr pHttpContext, IntPtr pvRequestContext);
+ public delegate bool PFN_SHUTDOWN_HANDLER(IntPtr pvRequestContext);
+ public delegate REQUEST_NOTIFICATION_STATUS PFN_ASYNC_COMPLETION(IntPtr pHttpContext, IntPtr completionInfo, IntPtr pvCompletionContext);
+
+ // TODO make this all internal
+ [DllImport(AspNetCoreModuleDll)]
+ public static extern int http_post_completion(IntPtr pHttpContext, int cbBytes);
+
+ [DllImport(AspNetCoreModuleDll)]
+ public static extern void http_indicate_completion(IntPtr pHttpContext, REQUEST_NOTIFICATION_STATUS notificationStatus);
+
+ [DllImport(AspNetCoreModuleDll)]
+ public static extern void register_callbacks(PFN_REQUEST_HANDLER request_callback, PFN_SHUTDOWN_HANDLER shutdown_callback, IntPtr pvRequestContext, IntPtr pvShutdownContext);
+
+ [DllImport(AspNetCoreModuleDll)]
+ internal unsafe static extern int http_write_response_bytes(IntPtr pHttpContext, HttpApiTypes.HTTP_DATA_CHUNK* pDataChunks, int nChunks, PFN_ASYNC_COMPLETION pfnCompletionCallback, IntPtr pvCompletionContext, out bool fCompletionExpected);
+
+ [DllImport(AspNetCoreModuleDll)]
+ public unsafe static extern int http_flush_response_bytes(IntPtr pHttpContext, PFN_ASYNC_COMPLETION pfnCompletionCallback, IntPtr pvCompletionContext, out bool fCompletionExpected);
+
+ [DllImport(AspNetCoreModuleDll)]
+ internal unsafe static extern HttpApiTypes.HTTP_REQUEST_V2* http_get_raw_request(IntPtr pHttpContext);
+
+ [DllImport(AspNetCoreModuleDll)]
+ internal unsafe static extern HttpApiTypes.HTTP_RESPONSE_V2* http_get_raw_response(IntPtr pHttpContext);
+
+ [DllImport(AspNetCoreModuleDll)]
+ public unsafe static extern void http_set_response_status_code(IntPtr pHttpContext, ushort statusCode, byte* pszReason);
+
+ [DllImport(AspNetCoreModuleDll)]
+ public unsafe static extern int http_read_request_bytes(IntPtr pHttpContext, byte* pvBuffer, int cbBuffer, PFN_ASYNC_COMPLETION pfnCompletionCallback, IntPtr pvCompletionContext, out int dwBytesReceived, out bool fCompletionExpected);
+
+ [DllImport(AspNetCoreModuleDll)]
+ public unsafe static extern bool http_get_completion_info(IntPtr pCompletionInfo, out int cbBytes, out int hr);
+
+ [DllImport(AspNetCoreModuleDll)]
+ [return: MarshalAs(UnmanagedType.BStr)]
+ public unsafe static extern string http_get_application_full_path();
+
+ [DllImport(AspNetCoreModuleDll)]
+ public unsafe static extern bool http_shutdown();
+
+ [DllImport("kernel32.dll")]
+ public static extern IntPtr GetModuleHandle(string lpModuleName);
+
+ public static bool is_ancm_loaded()
+ {
+ return GetModuleHandle(AspNetCoreModuleDll) != IntPtr.Zero;
+ }
}
}
diff --git a/src/Microsoft.AspNetCore.Server.IIS/DuplexStream.cs b/src/Microsoft.AspNetCore.Server.IISIntegration/Server/DuplexStream.cs
similarity index 97%
rename from src/Microsoft.AspNetCore.Server.IIS/DuplexStream.cs
rename to src/Microsoft.AspNetCore.Server.IISIntegration/Server/DuplexStream.cs
index 3a590d42fd..f8ebd8d792 100644
--- a/src/Microsoft.AspNetCore.Server.IIS/DuplexStream.cs
+++ b/src/Microsoft.AspNetCore.Server.IISIntegration/Server/DuplexStream.cs
@@ -6,7 +6,7 @@ using System.IO;
using System.Threading;
using System.Threading.Tasks;
-namespace Microsoft.AspNetCore.Server.IIS
+namespace Microsoft.AspNetCore.Server.IISIntegration
{
// TODO redudant file, remove
// See https://github.com/aspnet/IISIntegration/issues/426
diff --git a/src/Microsoft.AspNetCore.Server.IIS/HttpProtocol.FeatureCollection.cs b/src/Microsoft.AspNetCore.Server.IISIntegration/Server/HttpProtocol.FeatureCollection.cs
similarity index 99%
rename from src/Microsoft.AspNetCore.Server.IIS/HttpProtocol.FeatureCollection.cs
rename to src/Microsoft.AspNetCore.Server.IISIntegration/Server/HttpProtocol.FeatureCollection.cs
index 88c50ae7f4..35c97324cb 100644
--- a/src/Microsoft.AspNetCore.Server.IIS/HttpProtocol.FeatureCollection.cs
+++ b/src/Microsoft.AspNetCore.Server.IISIntegration/Server/HttpProtocol.FeatureCollection.cs
@@ -14,7 +14,7 @@ using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.WebUtilities;
using Microsoft.Extensions.Primitives;
-namespace Microsoft.AspNetCore.Server.IIS
+namespace Microsoft.AspNetCore.Server.IISIntegration
{
internal partial class HttpProtocol : IFeatureCollection,
IHttpRequestFeature,
diff --git a/src/Microsoft.AspNetCore.Server.IIS/HttpProtocol.Features.cs b/src/Microsoft.AspNetCore.Server.IISIntegration/Server/HttpProtocol.Features.cs
similarity index 99%
rename from src/Microsoft.AspNetCore.Server.IIS/HttpProtocol.Features.cs
rename to src/Microsoft.AspNetCore.Server.IISIntegration/Server/HttpProtocol.Features.cs
index a9f2a00968..d4677ad09a 100644
--- a/src/Microsoft.AspNetCore.Server.IIS/HttpProtocol.Features.cs
+++ b/src/Microsoft.AspNetCore.Server.IISIntegration/Server/HttpProtocol.Features.cs
@@ -6,7 +6,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
-namespace Microsoft.AspNetCore.Server.IIS
+namespace Microsoft.AspNetCore.Server.IISIntegration
{
internal partial class HttpProtocol
{
diff --git a/src/Microsoft.AspNetCore.Server.IIS/HttpProtocol.cs b/src/Microsoft.AspNetCore.Server.IISIntegration/Server/HttpProtocol.cs
similarity index 99%
rename from src/Microsoft.AspNetCore.Server.IIS/HttpProtocol.cs
rename to src/Microsoft.AspNetCore.Server.IISIntegration/Server/HttpProtocol.cs
index 53baf95d2b..b3b827ff8f 100644
--- a/src/Microsoft.AspNetCore.Server.IIS/HttpProtocol.cs
+++ b/src/Microsoft.AspNetCore.Server.IISIntegration/Server/HttpProtocol.cs
@@ -18,7 +18,7 @@ using Microsoft.AspNetCore.HttpSys.Internal;
using Microsoft.AspNetCore.WebUtilities;
using Microsoft.Extensions.Primitives;
-namespace Microsoft.AspNetCore.Server.IIS
+namespace Microsoft.AspNetCore.Server.IISIntegration
{
internal abstract partial class HttpProtocol : NativeRequestContext, IDisposable
{
diff --git a/src/Microsoft.AspNetCore.Server.IIS/IISAwaitable.cs b/src/Microsoft.AspNetCore.Server.IISIntegration/Server/IISAwaitable.cs
similarity index 96%
rename from src/Microsoft.AspNetCore.Server.IIS/IISAwaitable.cs
rename to src/Microsoft.AspNetCore.Server.IISIntegration/Server/IISAwaitable.cs
index f00987b9f5..55663c85a6 100644
--- a/src/Microsoft.AspNetCore.Server.IIS/IISAwaitable.cs
+++ b/src/Microsoft.AspNetCore.Server.IISIntegration/Server/IISAwaitable.cs
@@ -8,10 +8,10 @@ using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
-namespace Microsoft.AspNetCore.Server.IIS
+namespace Microsoft.AspNetCore.Server.IISIntegration
{
// Primarily copied from https://github.com/aspnet/KestrelHttpServer/blob/dev/src/Kestrel.Transport.Libuv/Internal/LibuvAwaitable.cs
- public class IISAwaitable : ICriticalNotifyCompletion
+ internal class IISAwaitable : ICriticalNotifyCompletion
{
private readonly static Action _callbackCompleted = () => { };
diff --git a/src/Microsoft.AspNetCore.Server.IIS/IISHttpContextOfT.cs b/src/Microsoft.AspNetCore.Server.IISIntegration/Server/IISHttpContextOfT.cs
similarity index 98%
rename from src/Microsoft.AspNetCore.Server.IIS/IISHttpContextOfT.cs
rename to src/Microsoft.AspNetCore.Server.IISIntegration/Server/IISHttpContextOfT.cs
index f56ee06909..2e1a597ca5 100644
--- a/src/Microsoft.AspNetCore.Server.IIS/IISHttpContextOfT.cs
+++ b/src/Microsoft.AspNetCore.Server.IISIntegration/Server/IISHttpContextOfT.cs
@@ -7,7 +7,7 @@ using Microsoft.AspNetCore.Hosting.Server;
using System.Threading;
using System.IO.Pipelines;
-namespace Microsoft.AspNetCore.Server.IIS
+namespace Microsoft.AspNetCore.Server.IISIntegration
{
internal class IISHttpContextOfT : HttpProtocol
{
diff --git a/src/Microsoft.AspNetCore.Server.IIS/IISHttpRequestBody.cs b/src/Microsoft.AspNetCore.Server.IISIntegration/Server/IISHttpRequestBody.cs
similarity index 98%
rename from src/Microsoft.AspNetCore.Server.IIS/IISHttpRequestBody.cs
rename to src/Microsoft.AspNetCore.Server.IISIntegration/Server/IISHttpRequestBody.cs
index daec49f990..b4a761945e 100644
--- a/src/Microsoft.AspNetCore.Server.IIS/IISHttpRequestBody.cs
+++ b/src/Microsoft.AspNetCore.Server.IISIntegration/Server/IISHttpRequestBody.cs
@@ -9,7 +9,7 @@ using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
-namespace Microsoft.AspNetCore.Server.IIS
+namespace Microsoft.AspNetCore.Server.IISIntegration
{
internal class IISHttpRequestBody : Stream
{
diff --git a/src/Microsoft.AspNetCore.Server.IIS/IISHttpResponseBody.cs b/src/Microsoft.AspNetCore.Server.IISIntegration/Server/IISHttpResponseBody.cs
similarity index 97%
rename from src/Microsoft.AspNetCore.Server.IIS/IISHttpResponseBody.cs
rename to src/Microsoft.AspNetCore.Server.IISIntegration/Server/IISHttpResponseBody.cs
index 862784f714..56c65292e8 100644
--- a/src/Microsoft.AspNetCore.Server.IIS/IISHttpResponseBody.cs
+++ b/src/Microsoft.AspNetCore.Server.IISIntegration/Server/IISHttpResponseBody.cs
@@ -6,7 +6,7 @@ using System.IO;
using System.Threading;
using System.Threading.Tasks;
-namespace Microsoft.AspNetCore.Server.IIS
+namespace Microsoft.AspNetCore.Server.IISIntegration
{
internal class IISHttpResponseBody : Stream
{
diff --git a/src/Microsoft.AspNetCore.Server.IIS/IISHttpServer.cs b/src/Microsoft.AspNetCore.Server.IISIntegration/Server/IISHttpServer.cs
similarity index 84%
rename from src/Microsoft.AspNetCore.Server.IIS/IISHttpServer.cs
rename to src/Microsoft.AspNetCore.Server.IISIntegration/Server/IISHttpServer.cs
index d126bc65c3..e414b515ea 100644
--- a/src/Microsoft.AspNetCore.Server.IIS/IISHttpServer.cs
+++ b/src/Microsoft.AspNetCore.Server.IISIntegration/Server/IISHttpServer.cs
@@ -11,9 +11,9 @@ using Microsoft.AspNetCore.Hosting.Server;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.Extensions.DependencyInjection;
-namespace Microsoft.AspNetCore.Server.IIS
+namespace Microsoft.AspNetCore.Server.IISIntegration
{
- public class IISHttpServer : IServer
+ internal class IISHttpServer : IServer
{
private static NativeMethods.PFN_REQUEST_HANDLER _requestHandler = HandleRequest;
private static NativeMethods.PFN_SHUTDOWN_HANDLER _shutdownHandler = HandleShutdown;
@@ -122,25 +122,4 @@ namespace Microsoft.AspNetCore.Server.IIS
{
HttpProtocol CreateHttpContext(IntPtr pHttpContext);
}
-
- public static class WebHostBuilderExtensions
- {
- public static IWebHostBuilder UseNativeIIS(this IWebHostBuilder builder)
- {
- if (NativeMethods.is_ancm_loaded())
- {
- // TODO put this in options and use path.
- var path = NativeMethods.http_get_application_full_path();
- builder.UseContentRoot(path);
- return builder.ConfigureServices(services =>
- {
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
- {
- services.AddSingleton();
- }
- });
- }
- return builder;
- }
- }
}
diff --git a/src/Microsoft.AspNetCore.Server.IIS/OutputProducer.cs b/src/Microsoft.AspNetCore.Server.IISIntegration/Server/OutputProducer.cs
similarity index 97%
rename from src/Microsoft.AspNetCore.Server.IIS/OutputProducer.cs
rename to src/Microsoft.AspNetCore.Server.IISIntegration/Server/OutputProducer.cs
index 7961c66e31..57391e80de 100644
--- a/src/Microsoft.AspNetCore.Server.IIS/OutputProducer.cs
+++ b/src/Microsoft.AspNetCore.Server.IISIntegration/Server/OutputProducer.cs
@@ -6,9 +6,9 @@ using System.IO.Pipelines;
using System.Threading;
using System.Threading.Tasks;
-namespace Microsoft.AspNetCore.Server.IIS
+namespace Microsoft.AspNetCore.Server.IISIntegration
{
- public class OutputProducer
+ internal class OutputProducer
{
private static readonly ArraySegment _emptyData = new ArraySegment(new byte[0]);
diff --git a/src/Microsoft.AspNetCore.Server.IISIntegration/WebHostBuilderIISExtensions.cs b/src/Microsoft.AspNetCore.Server.IISIntegration/WebHostBuilderIISExtensions.cs
index 1417c532ac..7d452f97f1 100644
--- a/src/Microsoft.AspNetCore.Server.IISIntegration/WebHostBuilderIISExtensions.cs
+++ b/src/Microsoft.AspNetCore.Server.IISIntegration/WebHostBuilderIISExtensions.cs
@@ -2,13 +2,13 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
-using System.Linq;
-using Microsoft.AspNetCore.Authentication;
+using System.Runtime.InteropServices;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.HttpOverrides;
using Microsoft.AspNetCore.Server.IISIntegration;
using Microsoft.Extensions.DependencyInjection;
+using Microsoft.AspNetCore.Hosting.Server;
namespace Microsoft.AspNetCore.Hosting
{
@@ -39,6 +39,21 @@ namespace Microsoft.AspNetCore.Hosting
return hostBuilder;
}
+ // Check if in process
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && NativeMethods.is_ancm_loaded())
+ {
+ hostBuilder.UseSetting(nameof(UseIISIntegration), "true");
+ hostBuilder.CaptureStartupErrors(true);
+
+ var applicationPath = NativeMethods.http_get_application_full_path();
+ hostBuilder.UseContentRoot(applicationPath);
+ return hostBuilder.ConfigureServices(services =>
+ {
+ services.AddSingleton();
+ services.AddAuthenticationCore();
+ });
+ }
+
var port = hostBuilder.GetSetting(ServerPort) ?? Environment.GetEnvironmentVariable($"ASPNETCORE_{ServerPort}");
var path = hostBuilder.GetSetting(ServerPath) ?? Environment.GetEnvironmentVariable($"ASPNETCORE_{ServerPath}");
var pairingToken = hostBuilder.GetSetting(PairingToken) ?? Environment.GetEnvironmentVariable($"ASPNETCORE_{PairingToken}");
diff --git a/test/IISIntegration.IISServerFunctionalTests/IISIntegration.IISServerFunctionalTests.csproj b/test/IISIntegration.IISServerFunctionalTests/IISIntegration.IISServerFunctionalTests.csproj
index ec40efd415..7a6a32c517 100644
--- a/test/IISIntegration.IISServerFunctionalTests/IISIntegration.IISServerFunctionalTests.csproj
+++ b/test/IISIntegration.IISServerFunctionalTests/IISIntegration.IISServerFunctionalTests.csproj
@@ -6,7 +6,7 @@
-
+
diff --git a/test/IISTestSite/IISTestSite.csproj b/test/IISTestSite/IISTestSite.csproj
index e0af089c35..37d65cc5e9 100644
--- a/test/IISTestSite/IISTestSite.csproj
+++ b/test/IISTestSite/IISTestSite.csproj
@@ -6,7 +6,7 @@
-
+
diff --git a/test/IISTestSite/Program.cs b/test/IISTestSite/Program.cs
index 26f06d38fb..5e22d2f2c6 100644
--- a/test/IISTestSite/Program.cs
+++ b/test/IISTestSite/Program.cs
@@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNetCore.Hosting;
-using Microsoft.AspNetCore.Server.IIS;
using Microsoft.Extensions.Logging;
namespace IISTestSite
@@ -17,7 +16,7 @@ namespace IISTestSite
factory.AddConsole();
factory.AddFilter("Console", level => level >= LogLevel.Information);
})
- .UseNativeIIS()
+ .UseIISIntegration()
.UseStartup("IISTestSite")
.Build();