如何将遗留的ASP应用程序转换成ASP.NET?

时间:2022-10-30 14:30:42

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

我们有一个大型的ASP(经典的ASP)应用程序,我们想把它转换成。net,以便进行进一步的发布。继续使用ASP毫无意义,因为它已经过时了,我们不想从头重写它(Joel Spolsky告诉您为什么)。

Is there a way to convert it from ASP to ASP.NET automatically?

有办法把它从ASP转换成ASP吗?自动网吗?

4 个解决方案

#1


9  

Well, I used to work for the company where all web apps were classic ASP. When decision was made to move to .NET we had to find a way to transform 168(!) web apps into this new framework. I tried all the tools available at the time to do this and all failed.

我以前在一家公司工作,那里所有的网络应用都是典型的ASP。当决定迁移到。net时,我们必须找到一种方法,将168(!)web应用程序转换成这个新的框架。我尝试了当时所有可用的工具来做这件事,但都失败了。

Best way is to build a new web server and start there from scratch, this way you can be sure that upgrade will happen fast and will work without any hick-ups because of old-new integration. You will be able to choose what functionality and visual appearances to keep and which one to change. Do not waste your time on automatic tools to upgrade your old ASP files/sites into NET platform. None so far have ever worked properly.

最好的方法是构建一个新的web服务器,然后从头开始,这样您就可以确信,由于旧的新集成,升级将很快完成,并且不会出现任何问题。您将能够选择要保留的功能和视觉外观,以及要更改的外观。不要在自动工具上浪费你的时间来升级你的旧ASP文件/站点到网络平台。到目前为止,还没有一种方法能正常工作。

And on top of that if you have database on back end, you will run into problem with connection to it from web apps.

除此之外,如果你在后台有数据库,你会遇到网络应用程序的问题。

#2


19  

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.

即使有工具可以在经典的ASP和ASP之间进行转换。NET,它们不会产生非常好的结果:这两个环境在根本上是完全不同的。谷歌很快就会出现一些结果,主要是“我们会让我们在印度的人来做”的多样性。

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.

我的建议是现在不要碰你现有的ASP代码。在可预见的将来,微软将支持运行时环境,因此无需迁移。相反,开始使用ASP中的新功能。NET:通过这种方式,您将不会被遗留概念所阻碍,并且可以使用框架提供的新清凉(包括类似ASP的东西)。以任何你认为合适的方式。

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.

当然,您的新代码需要与现有的ASP环境一起工作。在ASP和ASP之间共享会话状态。NET很可能是您的第一个需求,但是您很快就会发现更多类似的问题。

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.

这些问题的“正确”解决方案将完全取决于您当前的代码和需求:有时,您可以将. net代码封装在COM对象中,供您的ASP代码使用,有时部分移植/迁移可能是解决方案。

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

#3


8  

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

微软在MSDN上发表了一篇关于将ASP页面迁移到ASP.NET的文章。他们主要告诉你在你的电脑/服务器上安装。net,每次转换一页。ASP和ASP。NET可以共存,所以可以将每个页面重命名为“aspx”。但是,您应该注意,会话状态和应用程序状态不在ASP和ASP之间共享。NET pages(请参阅@mdb的答案,了解解决该问题的方法)。

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:

还有ASP到ASP。NET迁移助理,但我不确定项目/程序是否仍然活跃。你可以从本页下载:

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

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

#4


1  

gmStudio is a comprehensive VB6/ASP/COM to .NET upgrade tool. It can read, analyze, interpret, rewrite and restructure (as C# or VB.NET) individual pages+includes or entire sites.

gmStudio是一个全面的VB6/ASP/COM到。net升级工具。它可以读取、分析、解释、重写和重构(如c#或VB.NET)单个页面+包含或整个站点。

The technology has been in active development since 2007 and we have used it to help us rewrite sites ranging from a few hundred pages to 1000s of pages.

这项技术自2007年以来一直处于积极开发中,我们使用它来帮助我们重写从几百页到1000页的站点。

The tool is endorsed on MSDN here.

该工具在MSDN上得到了支持。

A (old) demo video is on ScreenCast here. (I really need to update this! Until then, please let me know if you want a live demo to see the latest.)

一个(旧的)演示视频在屏幕上。(我真的需要更新一下!在那之前,请让我知道如果你想要一个现场演示看到最新。

There is a more lot to tell, please contact us if you are intrested.

如果您有兴趣,请与我们联系。

Disclaimer: I work for Great Migrations.

免责声明:我为大迁移工作。

#1


9  

Well, I used to work for the company where all web apps were classic ASP. When decision was made to move to .NET we had to find a way to transform 168(!) web apps into this new framework. I tried all the tools available at the time to do this and all failed.

我以前在一家公司工作,那里所有的网络应用都是典型的ASP。当决定迁移到。net时,我们必须找到一种方法,将168(!)web应用程序转换成这个新的框架。我尝试了当时所有可用的工具来做这件事,但都失败了。

Best way is to build a new web server and start there from scratch, this way you can be sure that upgrade will happen fast and will work without any hick-ups because of old-new integration. You will be able to choose what functionality and visual appearances to keep and which one to change. Do not waste your time on automatic tools to upgrade your old ASP files/sites into NET platform. None so far have ever worked properly.

最好的方法是构建一个新的web服务器,然后从头开始,这样您就可以确信,由于旧的新集成,升级将很快完成,并且不会出现任何问题。您将能够选择要保留的功能和视觉外观,以及要更改的外观。不要在自动工具上浪费你的时间来升级你的旧ASP文件/站点到网络平台。到目前为止,还没有一种方法能正常工作。

And on top of that if you have database on back end, you will run into problem with connection to it from web apps.

除此之外,如果你在后台有数据库,你会遇到网络应用程序的问题。

#2


19  

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.

即使有工具可以在经典的ASP和ASP之间进行转换。NET,它们不会产生非常好的结果:这两个环境在根本上是完全不同的。谷歌很快就会出现一些结果,主要是“我们会让我们在印度的人来做”的多样性。

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.

我的建议是现在不要碰你现有的ASP代码。在可预见的将来,微软将支持运行时环境,因此无需迁移。相反,开始使用ASP中的新功能。NET:通过这种方式,您将不会被遗留概念所阻碍,并且可以使用框架提供的新清凉(包括类似ASP的东西)。以任何你认为合适的方式。

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.

当然,您的新代码需要与现有的ASP环境一起工作。在ASP和ASP之间共享会话状态。NET很可能是您的第一个需求,但是您很快就会发现更多类似的问题。

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.

这些问题的“正确”解决方案将完全取决于您当前的代码和需求:有时,您可以将. net代码封装在COM对象中,供您的ASP代码使用,有时部分移植/迁移可能是解决方案。

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

#3


8  

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

微软在MSDN上发表了一篇关于将ASP页面迁移到ASP.NET的文章。他们主要告诉你在你的电脑/服务器上安装。net,每次转换一页。ASP和ASP。NET可以共存,所以可以将每个页面重命名为“aspx”。但是,您应该注意,会话状态和应用程序状态不在ASP和ASP之间共享。NET pages(请参阅@mdb的答案,了解解决该问题的方法)。

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:

还有ASP到ASP。NET迁移助理,但我不确定项目/程序是否仍然活跃。你可以从本页下载:

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

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

#4


1  

gmStudio is a comprehensive VB6/ASP/COM to .NET upgrade tool. It can read, analyze, interpret, rewrite and restructure (as C# or VB.NET) individual pages+includes or entire sites.

gmStudio是一个全面的VB6/ASP/COM到。net升级工具。它可以读取、分析、解释、重写和重构(如c#或VB.NET)单个页面+包含或整个站点。

The technology has been in active development since 2007 and we have used it to help us rewrite sites ranging from a few hundred pages to 1000s of pages.

这项技术自2007年以来一直处于积极开发中,我们使用它来帮助我们重写从几百页到1000页的站点。

The tool is endorsed on MSDN here.

该工具在MSDN上得到了支持。

A (old) demo video is on ScreenCast here. (I really need to update this! Until then, please let me know if you want a live demo to see the latest.)

一个(旧的)演示视频在屏幕上。(我真的需要更新一下!在那之前,请让我知道如果你想要一个现场演示看到最新。

There is a more lot to tell, please contact us if you are intrested.

如果您有兴趣,请与我们联系。

Disclaimer: I work for Great Migrations.

免责声明:我为大迁移工作。