简体   繁体   中英

HttpContextBase and System.Web in .NET Standard

I originally have code using HttpContextBase from System.Web in my ASP.NET Web MVC project.

I would like to extend this functionality to a project that is using .NET Core by moving the code into a .NET Standard Library so both projects using ASP.NET Web MVC and ASP.NET Core respectively can use it.

Is there a replacement library or method I can use instead of HttpContextBase in my .NET Standard library to share code?

You can use the Http.Abstractions library:

https://www.nuget.org/packages/Microsoft.AspNetCore.Http.Abstractions

HttpRequest req = new DefaultHttpRequest(...);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM