Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. 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.

The problem we are facing is that we have ~40 websites that run with .aspx web pages and have database connections to SQL Server. Not only that, but some sites have cart systems and custom built CMS admin panels, all of which needs to be ported.

There are a couple of options that we can see:

  1. Configure a Web App to Serve .aspx Pages? (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.

  2. Completely Rebuild Sites in .NET Core (not an option)

    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

    Is there a way to take .aspx pages and convert them in a quick fashion, or through a tool of sorts?

  4. Configure Linux/.NET Core to Work With Existing Sites (most ideal)

    Can we simply copy all the site files into the user's public_html folder and configure the dotnet service to display those pages?

Any insight/advice will be extremely helpful.

like image 617
Garrett Bromley Avatar asked Apr 11 '18 17:04

Garrett Bromley


People also ask

Can we add ASPX page in .NET Core?

ASP.Net 5 is like ASP.Net MVC , you cannot add . aspx page but . cshtml razor view into your Views folder. Save this answer.

Can we migrate .NET framework to .NET Core?

You can migrate your old project to the Core project using the 'dotnet migrate; command, which migrates the project. json and any other files that are required by the web application. The dotnet migrate command will not change your code in any way.

Is ASP.NET Core good for web development?

NET Core is one of the most popular and loved web-development frameworks to build web apps. Developers can create powerful apps faster with the ASP . NET Core Framework. It's a cross-platform open-source project with excellent technical assistance.


1 Answers

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. Take a look at What's the difference between .NET Core, .NET Framework, and 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.

For your first question "Configure a Web App to Serve .aspx Pages?", it is not feasible to render an MVC page using Web Forms. 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.

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. If I tweak your question slightly, it may be possible to run Web Forms on Linux using Mono. 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. 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.

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.

like image 76
tj-cappelletti Avatar answered Nov 09 '22 02:11

tj-cappelletti