Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Classic ASP in ASP.NET MVC (C#)

I have an application that I want to (eventually) convert to ASP.NET MVC. I want to do an all out service upgrade (to ASP.NET) but want to use current asp stuff to run the current functionality so I can upgrade small pieces while making incremental upgrades to the new framework. This site is heavily dependent on a VB6 DLL that is not very mature, so we will also want to upgrade this eventually too, potentially replacing the current functionality with web services. Is there a quick fix or is this task a 3 month + task? Also, I am sure it has been thought of before, the beauty of the MVC is that I would think there is a way to tackle this, though I am unsure of where to start. What would be the quickest way to convert this application (in 40 or so hours), where I can just make small configuration changes and have this working in ASP.NET MVC?

like image 359
Jeff Ancel Avatar asked Feb 03 '23 11:02

Jeff Ancel


2 Answers

The short answer is... You can't. The differences between classic asp and asp.net are fairly drastic not just in syntax but in overall design. MVC is not just a similar implementation to classic asp although it may look that way. Any conversion will take time, thought and effort to get it completely working.

The good news though, is that you can run them SxS so you can actually have classic asp code running under a site that is setup as an ASP.NET or ASP.NET MVC site. So with some duct tape you can peice together your upgraded solution part by part.

like image 161
Quintin Robinson Avatar answered Feb 06 '23 03:02

Quintin Robinson


Rewrite your VB6 DLL as a COM callable .NET assembly. Then, you can reference it both from ASP and ASP.NET.

Hopefully, most of the heavy lifting is in the VB6 DLLs. If so, you can then start migrating pages over to ASP.NET MVC as you want. You have to watch out for page-to-page communication - things like Session and Cookies. Cookies will pretty much work as is, but you'll need to move Session to something shareable between MVC and ASP like Sql Server. Unfortunately, that requires rewriting your Session calls in ASP to something else (possibly a COM wrapper around a .NET component again). Search and replace should do the trick, though.

As for the timeline and amount of work this entails - that's pretty context dependent on the amount of spaghetti in your existing app, how much logic is in the DLL vs. ASP, and how many pages you're migrating.

I don't think 40 hours is a reasonable amount of time to get up to speed with .NET, MVC, and rewrite - though I think 2-3 months could be.

like image 24
Mark Brackett Avatar answered Feb 06 '23 01:02

Mark Brackett