Skip to content

Commit b3824bc

Browse files
authored
Add HttpRuntime.WebObjectActivator (#480)
This API is only available .NET 4.7.2, so it won't be avaliable .NET Standard.
1 parent 50048e0 commit b3824bc

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/Microsoft.AspNetCore.SystemWebAdapters/Generated/ExcludedApis.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,7 @@ T:System.Web.IHtmlString
2727
T:System.Web.HtmlString
2828

2929
T:Microsoft.AspNetCore.SystemWebAdapters.ITraceContext
30+
31+
# Only available .NET 4.7.2+
32+
P:System.Web.HttpRuntime.WebObjectActivator
33+

src/Microsoft.AspNetCore.SystemWebAdapters/HttpRuntime.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@ private HttpRuntime()
1717

1818
public static string AppDomainAppPath => HostingEnvironmentAccessor.Current.Options.AppDomainAppPath;
1919

20-
public static Cache Cache => HostingEnvironmentAccessor.Current.Services.GetRequiredService<Cache>();
20+
public static IServiceProvider WebObjectActivator => HostingEnvironmentAccessor.Current.Services;
21+
22+
public static Cache Cache => WebObjectActivator.GetRequiredService<Cache>();
2123
}

0 commit comments

Comments
 (0)