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

查看:425
本文介绍了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(控制器/ http模块)中获得System.Web.FormsAuthentication。

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并不相同。网络。没有任何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天全站免登陆