从asp经典到asp.net最简单的转换方法是什么?

时间:2021-01-13 01:49:15

I am a .Net developer that has been tasked with upgrading a classic asp website to asp.net. The website is currently running on luck and bubble gum but there is not enough time or money to stop progress and do a full rewrite. Of course I will still need to be able to deliver new features while I am upgrading.

我是一个。net开发人员,负责将一个经典的asp网站升级到asp.net。该网站目前运行的运气和泡泡糖,但没有足够的时间或金钱阻止进展,并做全面重写。当然,我仍然需要能够在升级时交付新的特性。

What strategies should I use to make a smooth gradual change to asp.net? Should I convert to a single tier .net solution and then refactor to a proper multi-tier solution or should I design my business and data layers now? Should I go straight to 3.5 or is it easier to just get to 1.1 and upgrade to 2.0 or 3.5 after?

我应该使用什么策略来平稳地逐步地改变asp.net?我是否应该转换为单一的。net解决方案,然后重构到一个合适的多层解决方案,或者我现在应该设计我的业务和数据层?我应该直接升级到3.5,还是更容易升级到1.1,然后升级到2.0或3.5 ?

A full conversion would probably take 3-5 months. There is also some existing 1.1 code, which is why I am considering using that as a jumping off point.

完全转换可能需要3-5个月。还有一些现有的1.1代码,这就是为什么我考虑使用它作为出发点。

9 个解决方案

#1


11  

Having been a longtime classic asp programmer, and now an ASP.NET dev, I would take the time and architect it properly in the 2.0 framework (3.5 if you want/need the features).

曾经是一个资深的asp程序员,现在是asp。NET dev,我将花时间在2.0框架中适当地构建它(如果您想/需要这些特性,可以使用3.5)。

My last job we had a large handful of very badly build classic asp apps that we were rebuilding, and the "nuke and pave" approach was the most successful. Use the existing classic app as your functional spec and wireframes, and build your tasks and tech specs off of that.

我的上一份工作是我们在重建的大量非常糟糕的典型asp应用,而“nuke和pave”方法是最成功的。使用现有的经典应用程序作为你的功能规范和线框图,并完成你的任务和技术规格。

#2


13  

Don't throw away your code!

不要抛弃你的代码!

It's the single worst mistake you can make (on a large codebase). See Things You Should Never Do, Part 1.

这是您可能犯的最严重的错误(在大型代码基上)。看看你不应该做的事情,第一部分。

You've invested a lot of effort into that old code and worked out many bugs. Throwing it away is a classic developer mistake (and one I've done many times). It makes you feel "better", like a spring cleaning. But you don't need to buy a new apartment and all new furniture to outfit your house. You can work on one room at a time... and maybe some things just need a new paintjob. Hence, this is where refactoring comes in.

您已经在旧代码中投入了大量的精力,并解决了许多bug。扔掉它是一个典型的开发错误(我已经做过很多次了)。它让你感觉“更好”,就像春季大扫除。但是你不需要买一套新的公寓和所有的新家具来装饰你的房子。你可以一次只在一个房间里工作……也许有些东西需要新的油漆。因此,这就是重构的意义所在。

For new functionality in your app, write it in C# and call it from your classic ASP. You'll be forced to be modular when you rewrite this new code. When you have time, refactor parts of your old code into C# as well, and work out the bugs as you go. Eventually, you'll have replaced your app with all new code.

对于应用程序中的新功能,用c#编写它,并从经典的ASP调用它。重写这个新代码时,您将*采用模块化。当您有时间的时候,也将旧代码的一部分重构到c#中,并在运行时找出错误。最终,你会用所有的新代码替换你的应用。

You could also write your own compiler. We wrote one for our classic ASP app a long time ago to allow us to output PHP. It's called Wasabi and I think it's the reason Jeff Atwood thought Joel Spolsky went off his rocker. Actually, maybe we should just ship it, and then you could use that.

您还可以编写自己的编译器。很久以前,我们为我们的经典ASP应用程序写了一篇文章,允许我们输出PHP。它叫做芥末酱,我认为这就是杰夫·阿特伍德认为乔尔·斯波尔斯基精神失常的原因。实际上,也许我们应该把它寄出去,然后你就可以用它了。

It allowed us to switch our entire codebase to .NET for the next release while only rewriting a very small portion of our source. It also caused a bunch of people to call us crazy, but writing a compiler is not that complicated, and it gave us a lot of flexibility.

它允许我们将整个代码基转换为。net作为下一个版本,同时只重写一小部分源代码。这也让很多人觉得我们疯了,但是编写编译器并没有那么复杂,它给了我们很大的灵活性。

Also, if this is an internal only app, just leave it. Don't rewrite it - you are the only customer and if the requirement is you need to run it as classic asp, you can meet that requirement.

另外,如果这是一个内部唯一的应用,那就离开它。不要重写它——您是惟一的客户,如果需求是您需要将它作为经典的asp来运行,您可以满足这个需求。

#3


1  

How long would a complete conversion/rewrite take? It's also going to depend on how you've structured your original project.

完整的转换/重写需要多长时间?这也取决于你如何构建你的原始项目。

I can answer that you should just target v2.0 (3.5 if you want/need it's features) from the beginning. There's no need to subject yourself to 1.1 of the framework.

我可以回答说,从一开始你就应该瞄准v2.0(如果你想要/需要它的功能)。没有必要将自己限定在框架的1.1中。

#4


1  

Try these links

试试这些链接

Migrating from ASP

从ASP迁移

Key Considerations

关键的考虑

Converting ASP to ASP.NET

将ASP转换为ASP.NET

ASP to ASP.NET Migration Guide

ASP ASP。净移民指南

#5


0  

You may want to look at the new ASP.NET MVC framework. The level of flexibility is amazing and the coding style is slightly more akin to the ASP classic approach, albeit with much better separation of church and state.

您可能想看看新的ASP。净MVC框架。灵活性的层次是惊人的,编码风格稍微类似于ASP的经典方法,尽管教会和国家的分离要好得多。

#6


0  

Take a look at Snitz Forums (www.snitz.com) - they are currently in ASP but the port to ASP.NET is almost complete. Both code bases are available for you to look at so you may get an idea of how it has been done there to help you.

看一下Snitz论坛(www.snitz.com)——它们目前在ASP中,但在ASP中。网络几乎是完整的。这两个代码库都可以供您查看,以便您可以了解如何在这些代码库中进行帮助。

#7


0  

I would avoid going into .NET 1.1 since Microsoft is ending support for v 1.1 of the .NET Framework on 10/14/2008. The extended support runs through 10/8/2013 but is typically expensive to purchase. Any bugs or security holes will not be addressed and are your problem.

我将避免进入。net 1.1,因为微软将在2008年10月14日结束对。net框架v1.1的支持。延长的支持将持续到2013年8月10日,但通常购买成本较高。任何错误或安全漏洞都不会被解决,这是您的问题。

http://support.microsoft.com/lifecycle/?LN=en-us&x=11&y=10&p1=1249

http://support.microsoft.com/lifecycle/?LN=en-us&x=11&y=10&p1=1249

Paul

保罗

#8


0  

easiest way to do it is to just jump in head first. get some asp.net books and dive into visual studio. Do the examples, play with it, build something fun for yourself. You'll learn by doing.

最简单的方法就是先跳进去。获取一些asp.net书籍,并深入到visual studio中。做一些例子,发挥它,为自己建立一些有趣的东西。您将了解通过。

#9


0  

I'm also working on a gradual migration from classic ASP to ASP.NET. Our first phase is migrating some common logic from an ASP include to a .NET assembly that is exposed to COM Interop so they can be called by both classic ASP and ASP.NET. I've written some tests using ASPUnit to verify the behavior after migration to the .NET assembly (with the added benefit of safer refactoring). Once the core logic is in .NET, we can begin creating new pages in ASP.NET and migrating individual ASP pages to ASP.NET at our own pace.

我还在逐步地从传统的ASP迁移到ASP.NET。我们的第一阶段是将一些常见的逻辑从ASP include迁移到。net程序集,该程序集公开给COM Interop,这样经典的ASP和ASP.NET都可以调用它们。我已经编写了一些测试,使用ASPUnit来验证迁移到. net程序集之后的行为(增加了更安全重构的好处)。一旦核心逻辑在。net中,我们就可以开始在ASP中创建新的页面。NET和迁移单个ASP页面到ASP。以我们自己的速度。

I would recommend .NET 2.0 or 3.5 over 1.1. ASP.NET MVC looks like an attractive upgrade path.

我推荐。net 2.0或3.5而不是1.1。ASP。NET MVC看起来是一个有吸引力的升级路径。

#1


11  

Having been a longtime classic asp programmer, and now an ASP.NET dev, I would take the time and architect it properly in the 2.0 framework (3.5 if you want/need the features).

曾经是一个资深的asp程序员,现在是asp。NET dev,我将花时间在2.0框架中适当地构建它(如果您想/需要这些特性,可以使用3.5)。

My last job we had a large handful of very badly build classic asp apps that we were rebuilding, and the "nuke and pave" approach was the most successful. Use the existing classic app as your functional spec and wireframes, and build your tasks and tech specs off of that.

我的上一份工作是我们在重建的大量非常糟糕的典型asp应用,而“nuke和pave”方法是最成功的。使用现有的经典应用程序作为你的功能规范和线框图,并完成你的任务和技术规格。

#2


13  

Don't throw away your code!

不要抛弃你的代码!

It's the single worst mistake you can make (on a large codebase). See Things You Should Never Do, Part 1.

这是您可能犯的最严重的错误(在大型代码基上)。看看你不应该做的事情,第一部分。

You've invested a lot of effort into that old code and worked out many bugs. Throwing it away is a classic developer mistake (and one I've done many times). It makes you feel "better", like a spring cleaning. But you don't need to buy a new apartment and all new furniture to outfit your house. You can work on one room at a time... and maybe some things just need a new paintjob. Hence, this is where refactoring comes in.

您已经在旧代码中投入了大量的精力,并解决了许多bug。扔掉它是一个典型的开发错误(我已经做过很多次了)。它让你感觉“更好”,就像春季大扫除。但是你不需要买一套新的公寓和所有的新家具来装饰你的房子。你可以一次只在一个房间里工作……也许有些东西需要新的油漆。因此,这就是重构的意义所在。

For new functionality in your app, write it in C# and call it from your classic ASP. You'll be forced to be modular when you rewrite this new code. When you have time, refactor parts of your old code into C# as well, and work out the bugs as you go. Eventually, you'll have replaced your app with all new code.

对于应用程序中的新功能,用c#编写它,并从经典的ASP调用它。重写这个新代码时,您将*采用模块化。当您有时间的时候,也将旧代码的一部分重构到c#中,并在运行时找出错误。最终,你会用所有的新代码替换你的应用。

You could also write your own compiler. We wrote one for our classic ASP app a long time ago to allow us to output PHP. It's called Wasabi and I think it's the reason Jeff Atwood thought Joel Spolsky went off his rocker. Actually, maybe we should just ship it, and then you could use that.

您还可以编写自己的编译器。很久以前,我们为我们的经典ASP应用程序写了一篇文章,允许我们输出PHP。它叫做芥末酱,我认为这就是杰夫·阿特伍德认为乔尔·斯波尔斯基精神失常的原因。实际上,也许我们应该把它寄出去,然后你就可以用它了。

It allowed us to switch our entire codebase to .NET for the next release while only rewriting a very small portion of our source. It also caused a bunch of people to call us crazy, but writing a compiler is not that complicated, and it gave us a lot of flexibility.

它允许我们将整个代码基转换为。net作为下一个版本,同时只重写一小部分源代码。这也让很多人觉得我们疯了,但是编写编译器并没有那么复杂,它给了我们很大的灵活性。

Also, if this is an internal only app, just leave it. Don't rewrite it - you are the only customer and if the requirement is you need to run it as classic asp, you can meet that requirement.

另外,如果这是一个内部唯一的应用,那就离开它。不要重写它——您是惟一的客户,如果需求是您需要将它作为经典的asp来运行,您可以满足这个需求。

#3


1  

How long would a complete conversion/rewrite take? It's also going to depend on how you've structured your original project.

完整的转换/重写需要多长时间?这也取决于你如何构建你的原始项目。

I can answer that you should just target v2.0 (3.5 if you want/need it's features) from the beginning. There's no need to subject yourself to 1.1 of the framework.

我可以回答说,从一开始你就应该瞄准v2.0(如果你想要/需要它的功能)。没有必要将自己限定在框架的1.1中。

#4


1  

Try these links

试试这些链接

Migrating from ASP

从ASP迁移

Key Considerations

关键的考虑

Converting ASP to ASP.NET

将ASP转换为ASP.NET

ASP to ASP.NET Migration Guide

ASP ASP。净移民指南

#5


0  

You may want to look at the new ASP.NET MVC framework. The level of flexibility is amazing and the coding style is slightly more akin to the ASP classic approach, albeit with much better separation of church and state.

您可能想看看新的ASP。净MVC框架。灵活性的层次是惊人的,编码风格稍微类似于ASP的经典方法,尽管教会和国家的分离要好得多。

#6


0  

Take a look at Snitz Forums (www.snitz.com) - they are currently in ASP but the port to ASP.NET is almost complete. Both code bases are available for you to look at so you may get an idea of how it has been done there to help you.

看一下Snitz论坛(www.snitz.com)——它们目前在ASP中,但在ASP中。网络几乎是完整的。这两个代码库都可以供您查看,以便您可以了解如何在这些代码库中进行帮助。

#7


0  

I would avoid going into .NET 1.1 since Microsoft is ending support for v 1.1 of the .NET Framework on 10/14/2008. The extended support runs through 10/8/2013 but is typically expensive to purchase. Any bugs or security holes will not be addressed and are your problem.

我将避免进入。net 1.1,因为微软将在2008年10月14日结束对。net框架v1.1的支持。延长的支持将持续到2013年8月10日,但通常购买成本较高。任何错误或安全漏洞都不会被解决,这是您的问题。

http://support.microsoft.com/lifecycle/?LN=en-us&x=11&y=10&p1=1249

http://support.microsoft.com/lifecycle/?LN=en-us&x=11&y=10&p1=1249

Paul

保罗

#8


0  

easiest way to do it is to just jump in head first. get some asp.net books and dive into visual studio. Do the examples, play with it, build something fun for yourself. You'll learn by doing.

最简单的方法就是先跳进去。获取一些asp.net书籍,并深入到visual studio中。做一些例子,发挥它,为自己建立一些有趣的东西。您将了解通过。

#9


0  

I'm also working on a gradual migration from classic ASP to ASP.NET. Our first phase is migrating some common logic from an ASP include to a .NET assembly that is exposed to COM Interop so they can be called by both classic ASP and ASP.NET. I've written some tests using ASPUnit to verify the behavior after migration to the .NET assembly (with the added benefit of safer refactoring). Once the core logic is in .NET, we can begin creating new pages in ASP.NET and migrating individual ASP pages to ASP.NET at our own pace.

我还在逐步地从传统的ASP迁移到ASP.NET。我们的第一阶段是将一些常见的逻辑从ASP include迁移到。net程序集,该程序集公开给COM Interop,这样经典的ASP和ASP.NET都可以调用它们。我已经编写了一些测试,使用ASPUnit来验证迁移到. net程序集之后的行为(增加了更安全重构的好处)。一旦核心逻辑在。net中,我们就可以开始在ASP中创建新的页面。NET和迁移单个ASP页面到ASP。以我们自己的速度。

I would recommend .NET 2.0 or 3.5 over 1.1. ASP.NET MVC looks like an attractive upgrade path.

我推荐。net 2.0或3.5而不是1.1。ASP。NET MVC看起来是一个有吸引力的升级路径。