diff --git a/src/Microsoft.AspNetCore.SystemWebAdapters/Adapters/Features/IHttpHandlerFeature.cs b/src/Microsoft.AspNetCore.SystemWebAdapters/Adapters/Features/IHttpHandlerFeature.cs
new file mode 100644
index 0000000000..3174a0077f
--- /dev/null
+++ b/src/Microsoft.AspNetCore.SystemWebAdapters/Adapters/Features/IHttpHandlerFeature.cs
@@ -0,0 +1,28 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+#if NETCOREAPP
+
+using System.Diagnostics.CodeAnalysis;
+using System.Web;
+
+namespace Microsoft.AspNetCore.SystemWebAdapters.Features;
+
+///
+/// Represents the handlers for a given request.
+///
+[Experimental(Constants.ExperimentalFeatures.DiagnosticId)]
+public interface IHttpHandlerFeature
+{
+ ///
+ /// Gets or sets the current .
+ ///
+ IHttpHandler? Current { get; set; }
+
+ ///
+ /// Gets the previous handlers. When is set, the previous value should be surfaced here.
+ ///
+ IHttpHandler? Previous { get; }
+}
+
+#endif
diff --git a/src/Microsoft.AspNetCore.SystemWebAdapters/Generated/Header.txt b/src/Microsoft.AspNetCore.SystemWebAdapters/Generated/Header.txt
index 7dae5f0c92..3ca52c9826 100644
--- a/src/Microsoft.AspNetCore.SystemWebAdapters/Generated/Header.txt
+++ b/src/Microsoft.AspNetCore.SystemWebAdapters/Generated/Header.txt
@@ -18,4 +18,5 @@
#pragma warning disable CA1063 // Implement IDisposable Correctly
#pragma warning disable CA1816 // Dispose methods should call SuppressFinalize
#pragma warning disable CS0436 // Type conflicts with imported type
+#pragma warning disable CA1040 // Avoid empty interfaces
diff --git a/src/Microsoft.AspNetCore.SystemWebAdapters/Generated/Ref.Standard.cs b/src/Microsoft.AspNetCore.SystemWebAdapters/Generated/Ref.Standard.cs
index 84ec1ff5a5..8f0a976e7d 100644
--- a/src/Microsoft.AspNetCore.SystemWebAdapters/Generated/Ref.Standard.cs
+++ b/src/Microsoft.AspNetCore.SystemWebAdapters/Generated/Ref.Standard.cs
@@ -18,6 +18,7 @@
#pragma warning disable CA1063 // Implement IDisposable Correctly
#pragma warning disable CA1816 // Dispose methods should call SuppressFinalize
#pragma warning disable CS0436 // Type conflicts with imported type
+#pragma warning disable CA1040 // Avoid empty interfaces
namespace System.Web
{
@@ -139,11 +140,14 @@ internal HttpContext() { }
public System.Web.HttpApplication ApplicationInstance { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
public System.Web.Caching.Cache Cache { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
public static System.Web.HttpContext Current { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} set { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
+ public System.Web.IHttpHandler CurrentHandler { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
public System.Web.RequestNotification CurrentNotification { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
public System.Exception Error { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
+ public System.Web.IHttpHandler Handler { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} set { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
public bool IsDebuggingEnabled { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
public bool IsPostNotification { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
public System.Collections.IDictionary Items { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
+ public System.Web.IHttpHandler PreviousHandler { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
public System.Web.HttpRequest Request { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
public System.Web.HttpResponse Response { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
public System.Web.HttpServerUtility Server { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
@@ -154,6 +158,7 @@ internal HttpContext() { }
public void AddError(System.Exception ex) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
public void ClearError() { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
public System.Web.ISubscriptionToken DisposeOnPipelineCompleted(System.IDisposable target) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
+ public void RemapHandler(System.Web.IHttpHandler handler) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
public void RewritePath(string path) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
public void RewritePath(string path, bool rebaseClientPath) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
public void RewritePath(string filePath, string pathInfo, string queryString) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
@@ -168,11 +173,14 @@ public partial class HttpContextBase : System.IServiceProvider
public virtual System.Web.HttpApplicationState Application { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
public virtual System.Web.HttpApplication ApplicationInstance { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
public virtual System.Web.Caching.Cache Cache { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
+ public virtual System.Web.IHttpHandler CurrentHandler { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
public virtual System.Web.RequestNotification CurrentNotification { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
public virtual System.Exception Error { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
+ public virtual System.Web.IHttpHandler Handler { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} set { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
public virtual bool IsDebuggingEnabled { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
public virtual bool IsPostNotification { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
public virtual System.Collections.IDictionary Items { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
+ public virtual System.Web.IHttpHandler PreviousHandler { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
public virtual System.Web.HttpRequestBase Request { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
public virtual System.Web.HttpResponseBase Response { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
public virtual System.Web.HttpServerUtilityBase Server { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
@@ -182,6 +190,7 @@ public partial class HttpContextBase : System.IServiceProvider
public virtual void AddError(System.Exception ex) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
public virtual void ClearError() { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
public virtual object GetService(System.Type serviceType) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
+ public virtual void RemapHandler(System.Web.IHttpHandler handler) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
public virtual void RewritePath(string path) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
public virtual void RewritePath(string path, bool rebaseClientPath) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
public virtual void RewritePath(string filePath, string pathInfo, string queryString) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
@@ -195,11 +204,14 @@ public partial class HttpContextWrapper : System.Web.HttpContextBase
public override System.Web.HttpApplicationState Application { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
public override System.Web.HttpApplication ApplicationInstance { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
public override System.Web.Caching.Cache Cache { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
+ public override System.Web.IHttpHandler CurrentHandler { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
public override System.Web.RequestNotification CurrentNotification { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
public override System.Exception Error { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
+ public override System.Web.IHttpHandler Handler { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} set { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
public override bool IsDebuggingEnabled { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
public override bool IsPostNotification { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
public override System.Collections.IDictionary Items { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
+ public override System.Web.IHttpHandler PreviousHandler { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
public override System.Web.HttpRequestBase Request { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
public override System.Web.HttpResponseBase Response { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
public override System.Web.HttpServerUtilityBase Server { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
@@ -209,6 +221,7 @@ public partial class HttpContextWrapper : System.Web.HttpContextBase
public override void AddError(System.Exception ex) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
public override void ClearError() { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
public override object GetService(System.Type serviceType) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
+ public override void RemapHandler(System.Web.IHttpHandler handler) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
public override void RewritePath(string path) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
public override void RewritePath(string path, bool rebaseClientPath) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
public override void RewritePath(string filePath, string pathInfo, string queryString) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
@@ -671,12 +684,32 @@ public partial class HttpSessionStateWrapper : System.Web.HttpSessionStateBase
public override void Remove(string name) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
public override void RemoveAll() { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
}
+ public abstract partial class HttpTaskAsyncHandler : System.Web.IHttpAsyncHandler, System.Web.IHttpHandler
+ {
+ protected HttpTaskAsyncHandler() { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
+ public virtual bool IsReusable { get { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");} }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ public virtual void ProcessRequest(System.Web.HttpContext context) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
+ public abstract System.Threading.Tasks.Task ProcessRequestAsync(System.Web.HttpContext context);
+ System.IAsyncResult System.Web.IHttpAsyncHandler.BeginProcessRequest(System.Web.HttpContext context, System.AsyncCallback cb, object extraData) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
+ void System.Web.IHttpAsyncHandler.EndProcessRequest(System.IAsyncResult result) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
+ }
public sealed partial class HttpUnhandledException : System.Web.HttpException
{
public HttpUnhandledException() { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
public HttpUnhandledException(string message) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
public HttpUnhandledException(string message, System.Exception innerException) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
}
+ public partial interface IHttpAsyncHandler : System.Web.IHttpHandler
+ {
+ System.IAsyncResult BeginProcessRequest(System.Web.HttpContext context, System.AsyncCallback cb, object extraData);
+ void EndProcessRequest(System.IAsyncResult result);
+ }
+ public partial interface IHttpHandler
+ {
+ bool IsReusable { get; }
+ void ProcessRequest(System.Web.HttpContext context);
+ }
public partial interface IHttpModule
{
void Dispose();
@@ -867,6 +900,12 @@ internal HttpSessionState() { }
public void Remove(string name) { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
public void RemoveAll() { throw new System.PlatformNotSupportedException("Only supported when running on ASP.NET Core or System.Web");}
}
+ public partial interface IReadOnlySessionState : System.Web.SessionState.IRequiresSessionState
+ {
+ }
+ public partial interface IRequiresSessionState
+ {
+ }
public enum SessionStateBehavior
{
Default = 0,
diff --git a/src/Microsoft.AspNetCore.SystemWebAdapters/Generated/TypeForwards.Framework.cs b/src/Microsoft.AspNetCore.SystemWebAdapters/Generated/TypeForwards.Framework.cs
index b5778eb986..914bfce378 100644
--- a/src/Microsoft.AspNetCore.SystemWebAdapters/Generated/TypeForwards.Framework.cs
+++ b/src/Microsoft.AspNetCore.SystemWebAdapters/Generated/TypeForwards.Framework.cs
@@ -18,6 +18,7 @@
#pragma warning disable CA1063 // Implement IDisposable Correctly
#pragma warning disable CA1816 // Dispose methods should call SuppressFinalize
#pragma warning disable CS0436 // Type conflicts with imported type
+#pragma warning disable CA1040 // Avoid empty interfaces
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Web.HttpApplication))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Web.HttpApplicationState))]
@@ -52,7 +53,10 @@
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Web.HttpServerUtilityWrapper))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Web.HttpSessionStateBase))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Web.HttpSessionStateWrapper))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Web.HttpTaskAsyncHandler))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Web.HttpUnhandledException))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Web.IHttpAsyncHandler))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Web.IHttpHandler))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Web.IHttpModule))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Web.ISubscriptionToken))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Web.ReadEntityBodyMode))]
@@ -70,5 +74,7 @@
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Web.Hosting.HostingEnvironment))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Web.Security.MachineKey))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Web.SessionState.HttpSessionState))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Web.SessionState.IReadOnlySessionState))]
+[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Web.SessionState.IRequiresSessionState))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Web.SessionState.SessionStateBehavior))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Web.SessionState.SessionStateMode))]
diff --git a/src/Microsoft.AspNetCore.SystemWebAdapters/HttpContext.cs b/src/Microsoft.AspNetCore.SystemWebAdapters/HttpContext.cs
index d3a85a36e5..60450ab52b 100644
--- a/src/Microsoft.AspNetCore.SystemWebAdapters/HttpContext.cs
+++ b/src/Microsoft.AspNetCore.SystemWebAdapters/HttpContext.cs
@@ -80,6 +80,18 @@ public IDictionary Items
public Cache Cache => Context.RequestServices.GetRequiredService();
+ public IHttpHandler? Handler
+ {
+ get => Context.Features.GetRequired().Current;
+ set => Context.Features.GetRequired().Current = value;
+ }
+
+ public IHttpHandler? CurrentHandler => Handler;
+
+ public IHttpHandler? PreviousHandler => Context.Features.GetRequired().Previous;
+
+ public void RemapHandler(IHttpHandler handler) => Handler = handler;
+
///
/// Gets whether the current request is running in the development environment.
///
diff --git a/src/Microsoft.AspNetCore.SystemWebAdapters/HttpContextBase.cs b/src/Microsoft.AspNetCore.SystemWebAdapters/HttpContextBase.cs
index 228a0fdcdb..7ec15b0fe2 100644
--- a/src/Microsoft.AspNetCore.SystemWebAdapters/HttpContextBase.cs
+++ b/src/Microsoft.AspNetCore.SystemWebAdapters/HttpContextBase.cs
@@ -42,6 +42,18 @@ protected HttpContextBase()
public virtual DateTime Timestamp => throw new NotImplementedException();
+ public virtual IHttpHandler? Handler
+ {
+ get => throw new NotImplementedException();
+ set => throw new NotImplementedException();
+ }
+
+ public virtual IHttpHandler? CurrentHandler => throw new NotImplementedException();
+
+ public virtual IHttpHandler? PreviousHandler => throw new NotImplementedException();
+
+ public virtual void RemapHandler(IHttpHandler handler) => throw new NotImplementedException();
+
public virtual IPrincipal User
{
get => throw new NotImplementedException();
diff --git a/src/Microsoft.AspNetCore.SystemWebAdapters/HttpContextWrapper.cs b/src/Microsoft.AspNetCore.SystemWebAdapters/HttpContextWrapper.cs
index 99e0d89c5f..c59a31d3d4 100644
--- a/src/Microsoft.AspNetCore.SystemWebAdapters/HttpContextWrapper.cs
+++ b/src/Microsoft.AspNetCore.SystemWebAdapters/HttpContextWrapper.cs
@@ -72,6 +72,18 @@ public override IPrincipal User
public override Cache Cache => _context.Cache;
+ public override IHttpHandler? CurrentHandler => _context.CurrentHandler;
+
+ public override IHttpHandler? Handler
+ {
+ get => _context.Handler;
+ set => _context.Handler = value;
+ }
+
+ public override IHttpHandler? PreviousHandler => _context.PreviousHandler;
+
+ public override void RemapHandler(IHttpHandler handler) => _context.RemapHandler(handler);
+
public override void RewritePath(string path) => _context.RewritePath(path);
public override void RewritePath(string path, bool rebaseClientPath) => _context.RewritePath(path, rebaseClientPath);
diff --git a/src/Microsoft.AspNetCore.SystemWebAdapters/HttpTaskAsyncHandler.cs b/src/Microsoft.AspNetCore.SystemWebAdapters/HttpTaskAsyncHandler.cs
new file mode 100644
index 0000000000..eb2782f06f
--- /dev/null
+++ b/src/Microsoft.AspNetCore.SystemWebAdapters/HttpTaskAsyncHandler.cs
@@ -0,0 +1,46 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using System.ComponentModel;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace System.Web;
+
+[Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1033:Interface methods should be callable by child types", Justification = Constants.ApiFromAspNet)]
+public abstract class HttpTaskAsyncHandler : IHttpAsyncHandler, IHttpHandler
+{
+ public virtual bool IsReusable => false;
+
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public virtual void ProcessRequest(HttpContext context) => throw new NotSupportedException($"{GetType()} cannot execute synchronously");
+
+ public abstract Task ProcessRequestAsync(HttpContext context);
+
+ IAsyncResult IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, object? extraData)
+ => new TaskWithState(ProcessRequestAsync(context).ContinueWith(t => cb(t), TaskScheduler.Current), extraData);
+
+ void IHttpAsyncHandler.EndProcessRequest(IAsyncResult result)
+ => ((TaskWithState)result).Wait();
+
+ private sealed class TaskWithState : IAsyncResult
+ {
+ private readonly IAsyncResult _task;
+
+ public TaskWithState(Task task, object? asyncState)
+ {
+ _task = task;
+ AsyncState = asyncState;
+ }
+
+ public void Wait() => ((Task)_task).Wait();
+
+ public object? AsyncState { get; }
+
+ public WaitHandle AsyncWaitHandle => _task.AsyncWaitHandle;
+
+ public bool CompletedSynchronously => _task.CompletedSynchronously;
+
+ public bool IsCompleted => _task.IsCompleted;
+ }
+}
diff --git a/src/Microsoft.AspNetCore.SystemWebAdapters/IHttpAsyncHandler.cs b/src/Microsoft.AspNetCore.SystemWebAdapters/IHttpAsyncHandler.cs
new file mode 100644
index 0000000000..2a38517370
--- /dev/null
+++ b/src/Microsoft.AspNetCore.SystemWebAdapters/IHttpAsyncHandler.cs
@@ -0,0 +1,11 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+namespace System.Web;
+
+public interface IHttpAsyncHandler : IHttpHandler
+{
+ IAsyncResult BeginProcessRequest(HttpContext context, AsyncCallback cb, object? extraData);
+
+ void EndProcessRequest(IAsyncResult result);
+}
diff --git a/src/Microsoft.AspNetCore.SystemWebAdapters/IHttpHandler.cs b/src/Microsoft.AspNetCore.SystemWebAdapters/IHttpHandler.cs
new file mode 100644
index 0000000000..0fdb04cf79
--- /dev/null
+++ b/src/Microsoft.AspNetCore.SystemWebAdapters/IHttpHandler.cs
@@ -0,0 +1,11 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+namespace System.Web;
+
+public interface IHttpHandler
+{
+ void ProcessRequest(HttpContext context);
+
+ bool IsReusable { get; }
+}
diff --git a/src/Microsoft.AspNetCore.SystemWebAdapters/IReadOnlySessionState.cs b/src/Microsoft.AspNetCore.SystemWebAdapters/IReadOnlySessionState.cs
new file mode 100644
index 0000000000..00a1fce4c6
--- /dev/null
+++ b/src/Microsoft.AspNetCore.SystemWebAdapters/IReadOnlySessionState.cs
@@ -0,0 +1,9 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+namespace System.Web.SessionState;
+
+[Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1040:Avoid empty interfaces", Justification = Constants.ApiFromAspNet)]
+public interface IReadOnlySessionState : IRequiresSessionState
+{
+}
diff --git a/src/Microsoft.AspNetCore.SystemWebAdapters/IRequiresSessionState.cs b/src/Microsoft.AspNetCore.SystemWebAdapters/IRequiresSessionState.cs
new file mode 100644
index 0000000000..a338b34401
--- /dev/null
+++ b/src/Microsoft.AspNetCore.SystemWebAdapters/IRequiresSessionState.cs
@@ -0,0 +1,9 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+namespace System.Web.SessionState;
+
+[Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1040:Avoid empty interfaces", Justification = Constants.ApiFromAspNet)]
+public interface IRequiresSessionState
+{
+}