Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true

# Additional styles
csharp_using_directive_placement = outside_namespace:warning

# CA1812: Do not have uninstantiated internal instance classes
dotnet_diagnostic.CA1812.severity = none

Expand Down
4 changes: 4 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,9 @@
Suppress a warning about the deprecation of netcoreapp2.1 since some packages/samples here target it
-->
<NoWarn>$(NoWarn);NETSDK1138</NoWarn>
<!--
Suppress warning for internal experimental APIs
-->
<NoWarn>$(NoWarn);SYSWEB1001</NoWarn>
</PropertyGroup>
</Project>
9 changes: 7 additions & 2 deletions Microsoft.AspNetCore.SystemWebAdapters.sln
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{F9DB9323-C919-49E8-8F96-B923D2F42E60}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{A1BDA50C-D70B-416C-97F1-74B0649797C5}"
ProjectSection(SolutionItems) = preProject
test\Directory.Build.props = test\Directory.Build.props
test\Directory.Build.targets = test\Directory.Build.targets
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RemoteBearer", "samples\RemoteAuth\Bearer\RemoteBearer\RemoteBearer.csproj", "{898C9B2C-E43A-434F-9927-F6697C0ACE40}"
EndProject
Expand Down Expand Up @@ -69,14 +73,15 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WebFormsToBlazor", "WebForm
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebFormsFramework", "samples\WebFormsToBlazor\WebFormsFramework\WebFormsFramework.csproj", "{0993BA4C-218B-43DD-A8A0-997B05808A08}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorCore", "samples\WebFormsToBlazor\BlazorCore\BlazorCore.csproj", "{23094126-C05C-4172-A01F-998780976709}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorCore", "samples\WebFormsToBlazor\BlazorCore\BlazorCore.csproj", "{23094126-C05C-4172-A01F-998780976709}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Modules", "Modules", "{4ED7A31C-8DBE-4A32-A17A-D72794F9FE2C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ModulesLibrary", "samples\Modules\ModulesLibrary\ModulesLibrary.csproj", "{5597A485-4D9B-4CE6-A489-DEBE9338450F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModulesFramework", "samples\Modules\ModulesFramework\ModulesFramework.csproj", "{B262AD69-11F0-4AE0-949A-AEAA2300C061}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModulesCore", "samples\Modules\ModulesCore\ModulesCore.csproj", "{F8B33C59-27CF-45DC-955C-2EBF9DA9DB7E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ModulesCore", "samples\Modules\ModulesCore\ModulesCore.csproj", "{F8B33C59-27CF-45DC-955C-2EBF9DA9DB7E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.SystemWebAdapters.Features;
using Microsoft.Extensions.Logging;

namespace Microsoft.AspNetCore.SystemWebAdapters;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.WebUtilities;

namespace Microsoft.AspNetCore.SystemWebAdapters;
namespace Microsoft.AspNetCore.SystemWebAdapters.Features;

internal class HttpRequestInputStreamFeature : IHttpRequestInputStreamFeature, IHttpRequestPathFeature, IHttpRequestFeature, IRequestBodyPipeFeature, IDisposable
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.WebUtilities;

namespace Microsoft.AspNetCore.SystemWebAdapters;
namespace Microsoft.AspNetCore.SystemWebAdapters.Features;

internal class HttpResponseAdapterFeature :
Stream,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Threading.Tasks;
using System.Web;

namespace Microsoft.AspNetCore.SystemWebAdapters;
namespace Microsoft.AspNetCore.SystemWebAdapters.Features;

internal sealed class RequestHttpApplicationFeature : IHttpApplicationFeature, IHttpResponseEndFeature, IRequestExceptionFeature
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.SystemWebAdapters;
using Microsoft.AspNetCore.SystemWebAdapters.Features;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.ObjectPool;
using Microsoft.Extensions.Options;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Threading.Tasks;
using System.Web;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.SystemWebAdapters.Features;
using Microsoft.Extensions.ObjectPool;

namespace Microsoft.AspNetCore.SystemWebAdapters;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Linq;
using System.Reflection;
using System.Web;
using Microsoft.AspNetCore.SystemWebAdapters.Features;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.ObjectPool;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.SystemWebAdapters;
using Microsoft.AspNetCore.SystemWebAdapters.Features;

namespace Microsoft.AspNetCore.OutputCaching;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.

using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.AspNetCore.SystemWebAdapters.Features;
using Microsoft.Extensions.Logging;

namespace Microsoft.AspNetCore.SystemWebAdapters.Mvc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.SystemWebAdapters.Features;

namespace Microsoft.AspNetCore.SystemWebAdapters;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.SystemWebAdapters;
using Microsoft.AspNetCore.SystemWebAdapters.Features;

namespace Microsoft.Extensions.DependencyInjection;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.SystemWebAdapters.Features;

namespace Microsoft.AspNetCore.SystemWebAdapters;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.SystemWebAdapters.Features;

namespace Microsoft.AspNetCore.SystemWebAdapters;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.SystemWebAdapters;
using Microsoft.AspNetCore.SystemWebAdapters.Features;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Logging;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@

#if NETCOREAPP

namespace Microsoft.AspNetCore.SystemWebAdapters;
using System.Diagnostics.CodeAnalysis;
using System.Web;

internal enum ApplicationEvent
namespace Microsoft.AspNetCore.SystemWebAdapters.Features;

[Experimental(Constants.ExperimentalFeatures.DiagnosticId)]
public enum ApplicationEvent
{
ApplicationStart,

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +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 Microsoft.AspNetCore.SystemWebAdapters;
#if NETCOREAPP
namespace Microsoft.AspNetCore.SystemWebAdapters.Features;

#if NET6_0_OR_GREATER
internal interface IBrowserCapabilitiesFactory
{
IHttpBrowserCapabilityFeature Create(HttpRequestCore request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@
#if NETCOREAPP

using System;
using System.Diagnostics.CodeAnalysis;
using System.Threading;
using System.Threading.Tasks;
using System.Web;

namespace Microsoft.AspNetCore.SystemWebAdapters;
namespace Microsoft.AspNetCore.SystemWebAdapters.Features;

internal interface IHttpApplicationFeature
/// <summary>
/// Represents the emulated IIS pipeline and the <see cref="HttpApplication"/> associated with it.
/// </summary>
[Experimental(Constants.ExperimentalFeatures.DiagnosticId)]
public interface IHttpApplicationFeature
{
/// <summary>
/// Gets the <see cref="HttpApplication"/> that is assigned to the current request.
Expand All @@ -20,9 +25,10 @@ internal interface IHttpApplicationFeature
/// <summary>
/// Raises events for the current application assigned to the request. See https://docs.microsoft.com/en-us/dotnet/api/system.web.httpapplication#remarks for details on how this worked in .NET Framework.
/// </summary>
/// <param name="event"></param>
/// <param name="appEvent"></param>
/// <returns></returns>
ValueTask RaiseEventAsync(ApplicationEvent @event);
[SuppressMessage("Design", "CA1030:Use events where appropriate", Justification = "May need to support async calls")]
ValueTask RaiseEventAsync(ApplicationEvent appEvent);

/// <summary>
/// Gets the current <see cref="RequestNotification"/> of where the request is in an emulated IIS pipeline.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// 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;

/// <summary>
/// Represents the key-value pair used by <see cref="HttpRequest.Browser"/>.
/// </summary>
[Experimental(Constants.ExperimentalFeatures.DiagnosticId)]
public interface IHttpBrowserCapabilityFeature
{
string? this[string key] { get; }
}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@

#if NETCOREAPP

using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using System.Web;

namespace Microsoft.AspNetCore.SystemWebAdapters;
namespace Microsoft.AspNetCore.SystemWebAdapters.Features;

internal interface IHttpRequestInputStreamFeature
/// <summary>
/// Feature to adapt the <see cref="HttpRequestCore.Body"/> to <see cref="HttpRequest.InputStream"/> and related members.
/// </summary>
[Experimental(Constants.ExperimentalFeatures.DiagnosticId)]
public interface IHttpRequestInputStreamFeature
{
/// <summary>
/// Gets the <see cref="ReadEntityBodyMode"/> of the request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,24 @@

#if NETCOREAPP

internal interface IHttpRequestPathFeature
using System.Diagnostics.CodeAnalysis;
using System.Web;

namespace Microsoft.AspNetCore.SystemWebAdapters.Features;

/// <summary>
/// Represents the path-related members on <see cref="HttpRequest"/>.
/// </summary>
[Experimental(Constants.ExperimentalFeatures.DiagnosticId)]
public interface IHttpRequestPathFeature
{
string Path { get; }

string PathInfo { get; }

string FilePath { get; }

[SuppressMessage("Design", "CA1056:URI-like properties should not be strings", Justification = Constants.ApiFromAspNet)]
string RawUrl { get; }

string? PhysicalPath { get; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Threading.Tasks;
using System.Web;

namespace Microsoft.AspNetCore.SystemWebAdapters;
namespace Microsoft.AspNetCore.SystemWebAdapters.Features;

internal interface IHttpResponseBufferingFeature
/// <summary>
/// Feature to allow buffering the response.
/// </summary>
[Experimental(Constants.ExperimentalFeatures.DiagnosticId)]
public interface IHttpResponseBufferingFeature
{
void EnableBuffering(int memoryThreshold, long? bufferLimit);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// 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;

/// <summary>
/// A feature that allows clearing the content or suppressing it.
/// </summary>
[Experimental(Constants.ExperimentalFeatures.DiagnosticId)]
public interface IHttpResponseContentFeature
{
bool SuppressContent { get; set; }

void ClearContent();
}

#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// 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.Threading.Tasks;
using System.Web;

namespace Microsoft.AspNetCore.SystemWebAdapters.Features;

/// <summary>
/// Represents whether a response has ended or allows transition into an ended state.
/// </summary>
[Experimental(Constants.ExperimentalFeatures.DiagnosticId)]
public interface IHttpResponseEndFeature
{
bool IsEnded { get; }

Task EndAsync();
}

#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// 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 Microsoft.AspNetCore.Http.Features.Authentication;
using System.Diagnostics.CodeAnalysis;
using System.Security.Claims;
using System.Security.Principal;
using System.Web;

namespace Microsoft.AspNetCore.SystemWebAdapters.Features;

/// <summary>
/// Represents the user as an <see cref="IPrincipal"/> as opposed to the in-built <see cref="IHttpAuthenticationFeature.User"/> which
/// expects a <see cref="ClaimsPrincipal"/>.
/// </summary>
[Experimental(Constants.ExperimentalFeatures.DiagnosticId)]
public interface IPrincipalUserFeature
{
IPrincipal? User { get; set; }
}

#endif
Loading