views:

1465

answers:

2

We have a large ASP (classic ASP) application and we would like to convert it to .NET in order to work on further releases. It makes no sense continuing to use ASP as it is obsolete, and we don't want to rewrite it from scratch (Joel Spolsky tells you why).

Are there any tools for converting from ASP to ASP.NET 2.0 or 3.5?

+3  A: 

Microsoft has an article up on MSDN that talks about Migrating ASP Pages to ASP.NET. They basically tell you to install .net on your computer/server and the transform one page at a time. ASP and ASP.NET can co-exist so can can rename each page to "aspx" as you go. You should note, however, that session state and application state are not shared between ASP and ASP.NET pages (See @mdb's answer for a workaround on that problem.)

There is also The ASP to ASP.NET Migration Assistant, but I'm not sure that project/program is still active. You can try it by downloading from this page:

http://www.asp.net/downloads/archived/migration-assistants/asp-to-aspnet/

Espo
+9  A: 

Even if there are tools to convert between classic ASP and ASP.NET, they're not going to generate very good results: the two environments are just too fundamentally different. A quick Google turns up a few results, mostly of the "we'll have our guys in India do it" variety.

My advice would be not to touch your existing ASP code for now. The runtime environment will be supported by Microsoft for the foreseeable future, so there's no urgent need to migrate. Instead, start working on new functionality in ASP.NET: this way, you won't be held back by legacy concepts, and can use the new coolness afforded by the Framework (including stuff like ASP.NET MVC) in any way you see fit.

Of course, your new code will need to work with the existing ASP environment. Sharing session state between ASP and ASP.NET will most likely be one of your first requirements, but you'll soon identify more issues like that.

The 'right' solution for such issues will depend entirely on your current code and requirements: sometimes, you'll be able to wrap .NET code in a COM object for use by your ASP code, sometimes partial porting/migration may be the solution.

However, on average, the 'two worlds' approach should be entirely feasible, and allow you to develop exciting new features without having to worry about your legacy code.


December 2009 addition to original answer: Just came across the ASP Classic Compiler, which is an actively maintained VBscript compiler that converts classic ASP pages into code that runs natively on ASP.NET. It has several cool features, such as the ability to use it as a ASP.NET MVC custom ViewEngine, so despite its beta status, it would definitely seem worth keeping an eye on...

mdb