Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
126 views
in Technique[技术] by (71.8m points)

c# - Can System.Web be used with ASP.Net Core with Full Framework

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

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

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

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)

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.

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.

Questions.

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

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...