System.Web 可以与具有完整框架的 ASP.Net Core 一起使用吗 [英] Can System.Web be used with ASP.Net Core with Full Framework

查看:27
本文介绍了System.Web 可以与具有完整框架的 ASP.Net Core 一起使用吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在运行基于不同 .Net 版本的多个站点.

We are running serveral sites based on different .Net versions.

其中一个站点运行 .Net 4.6 和 ASP.Net MVC 5.xx

One of the sites is running .Net 4.6 and ASP.Net MVC 5.xx

要使用 Razor 的新语法,我们希望将此站点升级为使用 .Net 4.6 和 ASP.Net Core

To use the new syntax for Razor we want to upgrade this site to use .Net 4.6 and ASP.Net Core

我们在我们的网站上使用 FormsAuthentication,我们将继续使用它,以便用户可以在网站之间移动.(其中一个站点是运行 FormsAuthentication 的 SharePoint 站点)

We use FormsAuthentication on our sites, and we will continue using that so user can move between sites. (one of the sites is a SharePoint site running FormsAuthentication)

我们知道 ASP.Net Core 没有使用 System.Web 中的任何东西,但我们需要使用来自控制器(以在登录期间创建 FormsAuthentication cookie)和来自 HttpModule 来验证 cookie.

We understand that ASP.Net Core is not using anything from System.Web but we need to use that from controllers (to create FormsAuthentication cookie during login) and from HttpModule to verify cookie.

我无法从运行带有完整框架的 ASP.Net Core 的站点中找到任何如何使用 system.web 的示例.我无法在 project.json 中为 system.web 添加依赖项.

I have not been able to find any example how to use system.web from a site running ASP.Net Core with Full framwork. I have not been able to add dependency for system.web in project.json.

问题.

  1. 是否可以从这样的设置中使用 system.web?

  1. Is it possible to use system.web from a setup like this?

我们如何向 system.web 添加依赖项,以便从 ASP.NET MVC 6 中获得 System.Web.FormsAuthentication.(控制器/http 模块)

How can we add dependency to system.web so System.Web.FormsAuthentication is available from ASP.NET MVC 6. (Controllers/ http module)

推荐答案

使用 System.Web dll 与使用 System.Web 不同.System.Web 管道都不会为您的 ASP.NET Core 应用程序运行,因此您无法执行您想要执行的操作.

Using the System.Web dll isn't the same as using System.Web. None of the System.Web pipeline will run for your ASP.NET Core application so you can't do what you are trying to do.

这篇关于System.Web 可以与具有完整框架的 ASP.Net Core 一起使用吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆