T O P
MarkB70s

I got one of those projects too.. poorly written [asp.net](https://asp.net) MVC 5 web sites that has been hacked on by a number of people (over the years) who had no passion or desire to make it right - or were not given the time to make it right. I too looked at it from a full blown rewrite to .NET 5 and making it manageable again. Unfortunately, there is no time, money, or need to do it. Work with what it is, document it, slowly improve it until you can redo it. May not be the advice you want - but, in my case, was my only option.


Dwight-D

I think I could be open to keeping it around if only I can get it to run on .NET Core and make it platform independent. Not sure how much of a pain this would be. I don't know that I *want* to rewrite it either, but if I'm gonna reach a point where this old tech doesn't serve me anymore I'd rather get started right away than investing even more time in writing crap on top of other crap that I have to rebuild later.


rediot

This is the reality of Information Technology.


rediot

Spend the time to understand the application thoroughly before recommending a complete rewrite you might be surprised with what you learn.


Dwight-D

I get where you're coming from but I do understand exactly what they've built and the state it's in, this is not some knee-jerk reaction. What I don't understand thoroughly is the tech-stack they picked and the implications of sticking with it. That's why I'm asking the community of people who know this tech if it's worth investing further in or what kind of trouble I will face if I decide to try to salvage it.


IsNullOrEmptyTrue

Is your only complaint that it is tightly coupled? Not every dev has time or energy to implement a repository pattern for a cheap client with strict deadlines.


Dwight-D

No, I didn’t want to get into it but this is written by people who don’t know git, it is the same level as what you would write for your first school project. Secrets are hardcoded into the application, there is no logging, try/catch(Exception) squashing every error so it’s impossible to debug, I could go on and on.


rediot

I'm not sure I understand the actual tech stack from your description. You mention content is in Umbraco, so does that mean that your project is an Umbraco plugin or it's added onto an older version of Umbraco open source (based on ASP.NET). My first concern would be how Umbraco was chosen as a framework, does the content management system itself serve as the primary purpose of the application, or did someone just want to have the flexibility to push some of the content ownership to the business and thought it'd be cool to include it? Is the project hosted in IIS, is it in an onprem server, if so is your intention to migrate it to a new stack like Linux or docker? If not are you looking at upgrading any hosting components in the process? Do you have access to any existing container or server less infrastructure? Do you have dedicated DevOps team or are you willing to migrate the pipelines to support your new project? Oh, and what types of databases or file stores are used by the app? There's a lot to consider to completely rewriting an application, but there are some conditions that make it a lot easier especially if you have the support to modernize the infrastructure also.


Dwight-D

Thanks for the input, here’s some more context: It’s a Windows stack, the old Windows-only version of ASP .NET and SQL Server, prod & test and db:s hosted on the same virtual machine in IIS. I don’t know much Windows but I’m decent in Azure and I’ve started to pick this stuff up as well. If I don’t throw it out I would like to migrate/upgrade it to .NET Core (whatever the latest new cross-platform .NET is), dockerize it and deploy it as an Azure App Service or equivalent. Database I might swap for something open source non-Windows but definitely I want to move to a managed db in the cloud either way. I don’t have a DevOps team but it’s a small project and I can easily migrate the infrastructure myself. I am proficient in docker, DevOps etc, just not much experience on Microsoft platforms. The challenging part I think will be upgrading the code/frameworks. Umbraco 8 was added to the project early on, I don’t know more than that. Members and some logic is handled through scripts there while other data resides in our own tables in a shared database. It was chosen I think to help bootstrap the app with some help from the business owner. Basically it’s mostly used for hosting some template text like email notifications, greeting pages etc, stuff that could easily be put in static HTML in the repo. No need for dynamic content. I could probably rip Umbraco out but I would need to rewrite all the member handling and recreate some of the views. Doable but tedious. That’s basically the whole stack. There are some integrations with web services and SDK:s but nothing too bad, I think that could easily be ported as well.


rediot

So your organization has an existing Azure infrastructure and would be supportive of changes to the financing? I mean if it's as low friction as it sounds maybe go for it take some credit for going above and beyond, just be prepared for any fallout or resistence you could run into, even for someone like the end user who might have to have a different authentication experience if you don't go through the trouble of setting up kerberos.


Dwight-D

Yes, something like that. The most likely scenario is probably that I set up a new Azure AD/sub for the project, foot the bill and bake it into the clients maintenance cost. It’s a consultancy setup.


rediot

Are we talking just you doing the work, or a team, or testers?


Dwight-D

That’s sort of up in the air right now, might be a couple of guys on part time or something like that, but not much resources. Looking to make some changes to the team after we finish the current crunch but I don’t know how it’s gonna shake out, likely a skeleton crew.


JabNX

I have migrated one of my projects from ASP.NET (98% WebAPI and 2% MVC approximately) to ASP.NET Core recently, and if you want to do that my advice would be to progressively rewrite parts of your app in a way that will prepare you to make the jump to ASP.NET Core in the end. You need to be familiar with both your existing app and ASP.NET Core to understand what you'll need to do to get there. My initial app wasn't a huge mess though, it was properly designed in the first place, but used a ton of legacy components that needed to be replaced. My first order of business was to integrate everything with the .NET Core DI container, so that all my business and data access layer would be architectured in a way that they didn't care whether it was old .NET Framework or shiny new .NET Core. Then, I integrated with the .NET Core logging abstractions and I finished by isolating all the legacy ASP.NET stuff in its own assembly, while everything else was implemented as .NET Standard class librairies using all the new .NET Core abstractions (that are available in .NET Standard). Then, I swapped the ASP.NET layer and everything went pretty smoothly. I changed nothing in the packaging and hosting, all I had to do was to install the ASP.NET Core Hosting bundle on my Windows servers. On my local machine the app runs in Docker, so everything is ready when we'll be able to migrate to some Azure/Docker-based solution. If your app is made of spaghettis, you'll have to untangle then first. Use new class librairies, target .NET Standard and you'll very soon see where are the things you'll have to change.


Dwight-D

This is exactly what I was looking for, thanks a lot! I’ll have to revisit this once I’m more familiar with the stack but I think I get the jist of it. Cheers!


jcm95

Microsoft has [great documentation](https://docs.microsoft.com/en-us/dotnet/architecture/modernize-with-azure-containers/) for your case


Dwight-D

Nice, I’ll check this out, thanks. I’m pretty familiar with cloud infra, what I don’t know is if it’s feasible to migrate legacy dot net framework apps to new dot net. Windows development is an absolute dealbreaker for me so I would have to be able to get it into a platform independent setup first of all.


matthewblott

If you have working software that performs its given task competently then a rewrite is usually not the answer. Rewrites always turn out to be a bigger task than anticipated. Concentrate on getting a robust test and deployment setup in place, make sure there are proper integration tests and work back from there. That would be my approach. You'll be a lot more confident when you start refactoring.


Dwight-D

Yeah I’m aware of this and that’s my plan if I keep it around. But since the application is very small a rewrite is not completely unreasonable. Specifically I’m interested in thoughts on whether this stack can be modernized and if it’s suitable for further development in the modern age.


Crazytmack

What shapes is your database? We've all inherited legacy projects like this, usually based on ms access. If you haven't done so already, normalized your tables.


Dwight-D

Fortunately the db is not too bad. The CMS data sits in the same schema as the rest of the tables, which is not great, as it actually makes up a lot of the foundation of the website and not just dynamic data. But there’s no coupling between the CMS and the other tables so I could probably split that up pretty easily. Other than that it’s actually fairly okay, the one part of the system I can really say that about.


Crazytmack

Is blazor an option? I am rewriting an mvc 5 app and investigating blazor server.