简体   繁体   English

将 .aspx 网站转换为 ASP.NET Core

[英]Converting .aspx Websites To ASP.NET Core

Our business has purchased an old web hosting company that runs a mixture of IIS and Apache sites across multiple servers.我们的企业购买了一家旧的网络托管公司,该公司在多台服务器上运行 IIS 和 Apache 站点的混合体。 We are planning the migration from the old infrastructure to our systems.我们正在计划从旧的基础设施迁移到我们的系统。

We want to run all these sites on Linux/Apache, and have installed ASP.NET Core on this Linux server with success and are able to serve a blank web app without issues following this tutorial , with some modifications.我们希望在 Linux/Apache 上运行所有这些站点,并且已经在这台 Linux 服务器上成功安装了 ASP.NET Core,并且能够按照本教程提供一个空白的 Web 应用程序而不会出现问题,并进行了一些修改。

The problem we are facing is that we have ~40 websites that run with .aspx web pages and have database connections to SQL Server.我们面临的问题是我们有大约 40 个使用 .aspx 网页运行并与 SQL Server 建立数据库连接的网站。 Not only that, but some sites have cart systems and custom built CMS admin panels, all of which needs to be ported.不仅如此,一些站点还有购物车系统和定制的 CMS 管理面板,所有这些都需要移植。

There are a couple of options that we can see:我们可以看到几个选项:

  1. Configure a Web App to Serve .aspx Pages?配置 Web 应用程序以提供 .aspx 页面? (not sure if even possible) (不确定是否甚至可能)

    I am not sure if this is even possible, to take the default template in .NET Core and configure it to render .aspx pages.我不确定这是否可行,在 .NET Core 中采用默认模板并将其配置为呈现 .aspx 页面。

  2. Completely Rebuild Sites in .NET Core (not an option)在 .NET Core 中完全重建站点(不是一个选项)

    This is simply not an option, due to the fact this migration is not billable to the clients and would take months, if not years to complete considering the small team we have.这根本不是一种选择,因为这种迁移不向客户收费,并且考虑到我们拥有的小团队,需要数月甚至数年才能完成。

  3. Merge Current Sites to .NET Core将当前站点合并到 .NET Core

    Is there a way to take .aspx pages and convert them in a quick fashion, or through a tool of sorts?有没有办法获取 .aspx 页面并以快速方式或通过某种工具转换它们?

  4. Configure Linux/.NET Core to Work With Existing Sites (most ideal)配置 Linux/.NET Core 以使用现有站点(最理想)

    Can we simply copy all the site files into the user's public_html folder and configure the dotnet service to display those pages?我们可以简单地将所有站点文件复制到用户的 public_html 文件夹中并配置 dotnet 服务以显示这些页面吗?

Any insight/advice will be extremely helpful.任何见解/建议都将非常有帮助。

First, it's important to point out that while .NET Core and the .NET Framework have many things in common, they are actually two different things.首先,需要指出的是,虽然 .NET Core 和 .NET Framework 有很多共同点,但它们实际上是两种不同的东西。 Take a look at What's the difference between .NET Core, .NET Framework, and Xamarin?看看.NET Core、.NET Framework 和 Xamarin 之间的区别什么? . .

The reason I point this out is because Web Forms (which is what ASPX pages uses) is not supported at all in .NET Core thus limiting your options.我指出这一点的原因是因为 .NET Core 根本不支持 Web 窗体(这是 ASPX 页面使用的),因此限制了您的选择。

For your first question "Configure a Web App to Serve .aspx Pages?", it is not feasible to render an MVC page using Web Forms.对于您的第一个问题“配置 Web 应用程序以提供 .aspx 页面?”,使用 Web 窗体呈现 MVC 页面是不可行的。 They work in two completely different ways.它们以两种完全不同的方式工作。

For you second question, "Completely Rebuild Sites in .NET Core", I get why that isn't a feasible option, but it is honestly the best option from a technical perspective if you wish to run only Linux based servers.对于您的第二个问题,“在 .NET Core 中完全重建站点”,我明白为什么这不是一个可行的选择,但如果您只想运行基于 Linux 的服务器,从技术角度来看,它确实是最好的选择。

For question three, I have not discovered a tool in my travels that does this but there may be one out there.对于问题三,我在旅行中没有发现可以做到这一点的工具,但可能有一个。

For your fourth question, "Configure Linux/.NET Core to Work With Existing Sites", the answer is no due to what I said at the start of my answer.对于您的第四个问题“配置 Linux/.NET Core 以与现有站点一起工作”,答案是否定的,因为我在回答开头所说的话。 If I tweak your question slightly, it may be possible to run Web Forms on Linux using Mono.如果我稍微调整一下您的问题,则可以使用 Mono 在 Linux 上运行 Web 窗体。 I have to stress the may part.我必须强调可能部分。 The Mono project ported the .NET Framework over to Linux and did a rather good job a preserving a lot of functionality. Mono 项目将 .NET Framework 移植到 Linux,并且在保留许多功能方面做得相当不错。 Depending on the application, you might be able to get it up and running using this framework but I can almost guarantee that not everything will cleanly port over to it.根据应用程序的不同,您也许可以使用这个框架来启动和运行它,但我几乎可以保证并不是所有的东西都可以干净地移植到它上面。 You might find that some applications will safely go while others you may just simply need to rewrite it in .NET Core.您可能会发现某些应用程序可以安全运行,而其他应用程序可能只需要在 .NET Core 中重写即可。

The last option you may want to seriously consider is biting the bullet and continue to let the 40 some sites run under IIS in Windows.您可能要认真考虑的最后一个选项是咬紧牙关,继续让 40 个站点在 Windows 的 IIS 下运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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