Migrated documents from aspclassiccompiler.codeplex.com
This commit is contained in:
parent
fe02219dac
commit
dbb36a62da
324 changed files with 75166 additions and 74841 deletions
71
License.txt
Normal file
71
License.txt
Normal file
|
@ -0,0 +1,71 @@
|
|||
http://www.codeplex.com/ASPClassicCompiler/license
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License.
|
||||
|
||||
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License.
|
||||
|
||||
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution.
|
||||
|
||||
You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
||||
|
||||
1. You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
||||
|
||||
2. You must cause any modified files to carry prominent notices stating that You changed the files; and
|
||||
|
||||
3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
||||
|
||||
4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions.
|
||||
|
||||
Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks.
|
||||
|
||||
This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty.
|
||||
|
||||
Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability.
|
||||
|
||||
In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability.
|
||||
|
||||
While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
3
docs/Acknowledgements.md
Normal file
3
docs/Acknowledgements.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
This project uses:
|
||||
* [Microsoft Dynamic Language Runtime](http://www.codeplex.com/dlr)
|
||||
* The VBScript Parser was adapted from [Paul Vick's VBParser](http://www.panopticoncentral.net/archive/2006/03/27/11531.aspx).
|
1
docs/Contact.md
Normal file
1
docs/Contact.md
Normal file
|
@ -0,0 +1 @@
|
|||
For general discussions, please use the project forum. If you have questions just for us, please use the contact user form. You might also visit [http://weblogs.asp.net/lichen/](http://weblogs.asp.net/lichen/) and use the contact user form there. Thanks.
|
5
docs/Contributors.md
Normal file
5
docs/Contributors.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
This project needs contributors to be viable. We need contributor of all technical capabilities, from writing a test case, and example, to working on the compiler.
|
||||
|
||||
To contribute to the project, go to the "Source Code" tab and click fork. You can then work in your fork. When you are ready to contribute your code, send a pull request. We will review your code and either accept or reject. Please fork once per idea to keep the change small so that it can be reviewed easily. Once you have a few successful contributions, you will be promoted to the Developer role.
|
||||
|
||||
This project uses Mercurial source control. Mercurial is thest best solution for open source development today. If you are not familiar with Mercurial, visit [Using Mercurial on Codeplex](http://codeplex.codeplex.com/wikipage?title=Using%20TortoiseHG%20with%20CodePlex) . Be sure to listen to [Rob Conery 's excellent tutorial](http://tekpub.com/codeplex). Also visit [hginit](http://hginit.com/) when you are ready for the next step. Mercurial promotes forking. We will be using workflow similar to [the Orchard Project](http://www.orchardproject.net/docs/Contributing-patches.ashx).
|
15
docs/FAQ.md
Normal file
15
docs/FAQ.md
Normal file
|
@ -0,0 +1,15 @@
|
|||
## Which .Net Framework version does the ASP Classic Compiler support?
|
||||
We will support .Net Framework 2.0, 3.0, 3.5 and 4.0. Initially, we only support 2.0-3.5. We do not support 4.0 because building the current DLR source code with 4.0 requires a daily build of VS2010 that we cannot obtain. Hopefully, we will be able to supply a copy of ASP Classic Compiler for .Net Framework 4.0 when VS 2010 beta 2 is released.
|
||||
|
||||
## What is the status of your project?
|
||||
At this time, we have implemented most features in VBScript 3.0 standard. It can [run](http://weblogs.asp.net/lichen/archive/2009/12/20/asp-classic-compiler-0-6-0-released-it-can-run-fmstocks-1-0.aspx) Microsoft end-to-end sample applications like FMStock. Still need to implement VBScript 5.0 features such as Class, Execute and Eval.
|
||||
|
||||
## What does the version number mean?
|
||||
Before 1.0, we used version numbers to represent the % of work completed to reach 1.0. So version 0.5.1.31188. would mean we are at 51%. The build number 31188 corresponds to the DLR changeset number so that you know the DLR version we are using in case you use other DLR languages in the same AppDomain.
|
||||
|
||||
## When are you going to release the 1.0 version?
|
||||
We are not able to commit to any schedule yet. We hope to release shortly after VS2010 is released or Dynamic Language Runtime 1.0 is released. We have overcome most major technical challenges but still have lots of loose ends to work on. That said, it is possible to focus our efforts on making some applications run correctly even before the general release. [Contact](Contact) us if you are interested in it.
|
||||
|
||||
## There are a huge number of ASP pages out there. How can you be compatible with all of them?
|
||||
Compiler writers work at the nuts and bolts level. We are concerned with the behavior of operators, assignments and method calls, etc. as well as all the implicit conversions involved. So we are dealing with a much smaller set of cases. We expect the system to be right if it is right at the nuts and bolts level. That said, to make VBScript.net right is still a huge task without a formal specification. There are many caveats in VBScript. Fortunately, [http://blogs.msdn.com/ericlippert/archive/tags/VBScript/default.aspx](Eric Lippert's blog) provides a lot more information. Some of the behavior is actually [http://blogs.msdn.com/ericlippert/archive/2005/03/23/vbscript-quiz-answers-part-eight.aspx](bugs that could not be fixed). So the answer is that we are not able to be and probably do not want to be 100% backward compatible. We will apply some common sense, encourage good practices and hopefully come out with a compiler that it is compatible with most of the real-world ASP pages. We will break away from some old problems and hopefully can move forward with a cleaner product. We certainly hope we will do much better than any of those ASP code converters on the market because we are not concerned with code readability but rather concerned with syntactic compatibility. Our development is very much spec and test driven at this point.
|
||||
|
45
docs/Features.md
Normal file
45
docs/Features.md
Normal file
|
@ -0,0 +1,45 @@
|
|||
# Features and Limitations
|
||||
|
||||
## VBScript.net compiler features:
|
||||
* For 1.0 release, we plan to implement VBScript 4.0 (see [http://msdn.microsoft.com/en-us/library/4y5y7bh5(VS.85).aspx](VBScript Version Information)). Features like defining classes in VBScript and the Eval/Execute/ExecuteGlobal are not implemented, although DLR does allow the implementation of these features. We plan to implement these features in a later release. However, if you would like to make these a higher priority, please vote in the Issue Tracker.
|
||||
* You can still use 5.x Regular Expression features since we are reusing Microsoft VBScript regular expression COM objects through COM interop. However, you must have Microsoft VBScript 5.x installed on your system.
|
||||
* The 5.0 Escape, GetLocal, SetLocal, Timer and Unescape functions are supported.
|
||||
* Interop with .net framework
|
||||
* All the types in VBScript.net compiler are natively CLR Types. Please also see [http://msdn.microsoft.com/en-us/library/9e7a57cf(VS.85).aspx](VBScript Data Types). The following are the mappings between the types in VBScript and the CLR types used VBScript.net:
|
||||
|| VBScript type || VBScript.net type||
|
||||
| Empty | null |
|
||||
| Null | System.DbNull |
|
||||
| Boolean | System.Boolean |
|
||||
| Byte | System.Byte |
|
||||
| Integer | System.Int16 |
|
||||
| Currency | System.Decimal |
|
||||
| Long | System.Int32 |
|
||||
| Single | System.Single |
|
||||
| Double | System.Double |
|
||||
| Date | System.DateTime |
|
||||
| String | System.String |
|
||||
| Object | System.Object |
|
||||
| Variant | System.Object |
|
||||
| Error | VBScript.net internal helper object |
|
||||
* Imports statement. Note that the behavior of the Imports statement in VBScript.net is different in VB.NET. See below:
|
||||
* Top namespace import. For example, if you use {{imports System}}, VBScript.net would know that the "System" is a namespace rather than a variable. However, when you use a class, you still have to specify the full namespace, for example, {{ System.Console.WriteLine("Hello World") }}. The reason is we do not do exhaustive searches in all imported namespaces to reduce the compiling time as a scripting language. If you do not want to type the entire namespace, you might use Alias Import.
|
||||
* Alias Import. You might define an alias for a namespace or a class, for example:
|
||||
{{
|
||||
imports c=System.Console
|
||||
c.WriteLine("hello world")
|
||||
}}
|
||||
|
||||
## VBScript.net compiler limitations
|
||||
# Can assign to a constant. This should not happen.
|
||||
# Imp and Eqv operators are not implemented. Not sure if anyone uses it. Submit an issue if you need it.
|
||||
# LoadPicture function not implemented.
|
||||
# There are many other more subtle incompatibilities (such as automatic widening of numeric type) that we have to document separately.
|
||||
|
||||
## ASP Classic Compiler Features:
|
||||
# Implemented as an asp.net http module. See [Installation](Installation) page for setup and configuration.
|
||||
|
||||
## ASP Classic Compiler limitations:
|
||||
# Global.asa not supported. If you want to add data to application or session state, use global.asax instead.
|
||||
# TypeLibrary declaration using syntax like {{<!--METADATA TYPE="typelib" uuid="00000206-0000-0010-8000-00AA006D2EA4" -->}} is not implemented. Use include file adovbs.inc instead.
|
||||
# ASP @ Directives ignored. @TRANSACTION declarative in ASP page is ignored. ASP page runs in a COM+ context. ASP Classic Compiler runs pages in asp.net worker process.
|
||||
# COM objects invoked by asp page cannot access built-in asp objects, request, response and session, etc. This is because ASP Classic Compiler does not put these objects into COM+ context. As a result, COM objects like MSWC.BrowserType would not work with ASP Classic Compiler.
|
76
docs/History.md
Normal file
76
docs/History.md
Normal file
|
@ -0,0 +1,76 @@
|
|||
* 3/29/2011 - Open the source code. See [Announcements](http://weblogs.asp.net/lichen/archive/2011/03/30/asp-classic-compiler-is-now-open-source.aspx).
|
||||
* Change Set 41463 - 4/4/2010 Version 0.6.2.34834 VS2010 and VS2008 Builds.
|
||||
# Fixed the bugs regarding unary operation binder and logical binary operation binder reported in this [post](http://aspclassiccompiler.codeplex.com/Thread/View.aspx?ThreadId=205235).
|
||||
# Runtime exception thrown by compiled VBScript can now report the name of the source file and line number if you enable tracing. See this [post](http://weblogs.asp.net/lichen/archive/2010/04/05/how-to-enable-tracing-in-asp-classic-compiler.aspx) on how to enable tracing.
|
||||
* Change Set 41199 - 3/27/2010 Version 0.6.1.34834 VS2010 and VS2008 Builds.
|
||||
# Fixed worked item 3954.
|
||||
# Fixed the bugs reported in this [post](http://aspclassiccompiler.codeplex.com/Thread/View.aspx?ThreadId=205235).
|
||||
# You can now using custom classes in Asp Classic Compiler. See this [post](http://weblogs.asp.net/lichen/archive/2010/03/28/using-custom-net-classes-in-asp-classic-compiler.aspx) for more details.
|
||||
* Change Set 33532 - 12/18/2009. Version 0.6.0.34834 VS2010 and VS2008 Builds. (Do not download 33384-33386 as they have build errors)
|
||||
# We reached a milestone today. ASP Classic Compiler is working now with a first end-to-end sample application, [Fitch and Mather Stocks 1.0](http://www.microsoft.com/downloads/details.aspx?FamilyID=243abaa0-dd03-4fbc-b58f-5da61839f948&DisplayLang=en).
|
||||
# We have included a [preconfigured copy](History_fmstocks10.zip) of Fitch and Mather application for you to try.
|
||||
# See [this](http://weblogs.asp.net/lichen/archive/2009/12/20/asp-classic-compiler-0-6-0-released-it-can-run-fmstocks-1-0.aspx) and [this](http://weblogs.asp.net/lichen/archive/2009/12/20/installing-fmstocks-1-0-on-later-platforms.aspx) blog entries for more information.
|
||||
* Change Set 32739 - 12/3/2009. Version 0.5.7.34834 VS2010 and VS 2008 Builds.
|
||||
# Fixed the bug in [this discussion](http://aspclassiccompiler.codeplex.com/Thread/View.aspx?ThreadId=76818).
|
||||
* Change Set 32557 - 11/30/2009. Version 0.5.6.34834 VS2010 and VS 2008 Builds. Still no Silverlight update.
|
||||
# Fixed numerous bugs in the parser and the code generator.
|
||||
# Implemented On Error.
|
||||
# Allows method redefinition. See this [discussion](http://aspclassiccompiler.codeplex.com/Thread/View.aspx?ThreadId=76620) for more details.
|
||||
* Change Set 32030 - 11/16/2009. Version 0.5.5.34834 VS2010 and VS2008 Builds. This release does not have a Silverlight build.
|
||||
# Setup the infrastructure to map from generated code back to the source code so that we can report the location accurately in ASP files.
|
||||
# If a file has multiple syntax errors, chances are that we are able to report all the errors at once. In contrast, ASP Classic only reports one error at a time. That is because our parser attempts to recover from the error and continue parsing the file.
|
||||
* Change Set 31328 - 11/3/2009. Silverlight samples uploaded. Minor bug fix to ASP include syntax. Visit [this blog](http://weblogs.asp.net/lichen/archive/2009/11/04/uploaded-silverlight-sample-for-vbscript-net-compiler.aspx) for details of the Silverlight sample.
|
||||
* Change Set 31281 - 11/2/2009. Version 0.5.4.34834. Built with DLR 0.92. We are going to stay with DLR 0.92 stable build for a while instead of using the weekly build so that we can be compatible with VS2010 beta2.
|
||||
# VS2010 build is available now in addition to the VS2008 build.
|
||||
# Silverlight build of our VBScript.NET compiler is available for the first time. We will try to come out with samples in the next weekly release.
|
||||
# All the binaries are consolidated into the bin folder.
|
||||
|
||||
* Change Set 30945 - 10/25/2009. Version 0.5.3.32871. Built with DLR Changeset 32871.
|
||||
# Now ASP Classic Compiler would run under medium trust or Windows Azure partial-trust. Partial-trust is the default trust level of Windows Azure. Windows Azure does not support ASP Classic. Windows Azure supports php but requires full-trust. ASP Classic Compiler is the only way to run ASP pages on Azure without changing the trust level.
|
||||
# Azure sample uploaded. We modified only one view /home/index.asp but that is enough to prove the concept.
|
||||
# Variable initialization in declaration statement as a VBScript extension. For example: Dim s = New System.Text.StringBuilder()
|
||||
# Add the operator overloading through extension methods. C# supports extension methods, but not "extension operators". We added this support so that we can add new behavior without the need to modify our binders. Some typical ASP code would now run much faster by a simple change. For example, ASP pages often have code like:
|
||||
{{
|
||||
<%
|
||||
Dim s
|
||||
Dim i
|
||||
|
||||
s = "<table>"
|
||||
For i = 1 To 12
|
||||
s = s + "<tr>"
|
||||
s = s + "<td>" + i + "</td>"
|
||||
s = s + "<td>" + MonthName(i) + "</td>"
|
||||
s = s + "</tr>"
|
||||
Next
|
||||
s = s + "</table>"
|
||||
Response.Write(s)
|
||||
|
||||
%>
|
||||
}}
|
||||
This code is slow because the runtime keeps creating new strings and discarding the old one. Now we just need a simple change:
|
||||
{{
|
||||
<%
|
||||
Imports System
|
||||
Dim s = New System.Text.StringBuilder()
|
||||
Dim i
|
||||
|
||||
s = s + "<table>"
|
||||
For i = 1 To 12
|
||||
s = s + "<tr>"
|
||||
s = s + "<td>" + i + "</td>"
|
||||
s = s + "<td>" + MonthName(i) + "</td>"
|
||||
s = s + "</tr>"
|
||||
Next
|
||||
s = s + "</table>"
|
||||
Response.Write(s)
|
||||
|
||||
%>
|
||||
}}
|
||||
Note that we added "+" operator as an extension operator for the class System.Text.StringBuilder.
|
||||
|
||||
* Change Set 30470 - 10/17/2009. Version 0.5.2.32072. Built with DLR Changeset 32072
|
||||
# Fixed a bug so that the default properties are retrieved when concatenating two COM objects.
|
||||
# Added support for extension methods. This is crucial for ASP.NET MVC support since many HtmlHelper methods are extension methods.
|
||||
# Created ASP view engine for ASP.NET MVC.
|
||||
# Ported [NerdDinner sample](http://nerddinner.codeplex.com) to use the ASP view engine. See [Port NerdDinner Sample to ASP View Engine](Port-NerdDinner-Sample-to-ASP-View-Engine) for more details.
|
||||
* Change Set 29666 - 10/08/2009* Initial release of version 0.5.1.31188. Built with DLR Changeset 31188.
|
BIN
docs/History_fmstocks10.zip
Normal file
BIN
docs/History_fmstocks10.zip
Normal file
Binary file not shown.
20
docs/Installation.md
Normal file
20
docs/Installation.md
Normal file
|
@ -0,0 +1,20 @@
|
|||
# Installation
|
||||
|
||||
## Build for .Net framework 2.0, 3.0, 3.5
|
||||
* Components that need to be copied to the bin dir of your web application
|
||||
|| Component Name || Description ||
|
||||
| Dlrsoft.asp.dll | ASP Classic Compiler runtime |
|
||||
| Dlrsoft.VBParser.dll | VBScript Parser |
|
||||
| Dlrsoft.VBScript.dll | VBScript.net compiler |
|
||||
| Microsoft.Dynamic.dll | Microsoft Dynamic Language Runtime |
|
||||
| Microsoft.Scripting.Core.dll | Microsoft Dynamic Language Runtime |
|
||||
| Microsoft.Scripting.dll | Microsoft Dynamic Language Runtime |
|
||||
| Microsoft.Scripting.ExtensionAttribute.dll | Microsoft Dynamic Language Runtime |
|
||||
* Configure the ASP Classic Compiler Http Handler. Add the following line to the httpHandlers section of web.config file:
|
||||
{{
|
||||
<add verb="**" path="**.asp" validate="false" type="Dlrsoft.Asp.AspHandler, Dlrsoft.Asp"/>
|
||||
}}
|
||||
Note that if you want to use a different file extension for ASP Classic Compiler, just modify the path attribute.
|
||||
* (optional) Configure ISAPI extensions. This step is required only if you want to use ASP Classic Compiler to handle asp pages in IIS. It is not required in Cassini.
|
||||
* IIS 5/6: In IIS Manager, go to Web Site Properties, on the Home Directory tab, click Configuration.... In Mappings tab, you will notice that asp is currently mapped to C:\WINDOWS\system32\inetsrv\asp.dll. Change it to executable that .aspx extension is using, e.g., c:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll.
|
||||
Note that if you use a different file extension for ASP Classic Compiler, just create a new ISAPI extension mapping.
|
36
docs/Port NerdDinner Sample to ASP View Engine.md
Normal file
36
docs/Port NerdDinner Sample to ASP View Engine.md
Normal file
|
@ -0,0 +1,36 @@
|
|||
Starting with change set 30470, we added an ASP.NET MVC sample that uses ASP Classic Compiler as a view engine. This sample was ported from the [NerdDinner sample](http://nerddinner.codeplex.com). We replaced all the webform views in the Dinner directory with ASP views. This should make the migration from Classic ASP to ASP.NET MVC with ASP view to a full ASP.NET MVC application very easy.
|
||||
|
||||
Most of the porting is quite trivial. I only need to mention a few things:
|
||||
# Since ASP view does not support master pages, we use Html.RenderPartial instead.
|
||||
# It is possible to mix the ASP view engine and the webform view engine. It is even possible to mix the view in a single page. This is demonstrated in the /Home/Index.asp view. We use ASP as the view but it uses the Login control as it's partial view.
|
||||
# C# supports the using block so that the object is disposed at the end of the block. The Dinner/Delete view uses HtmlHelper.BeginForm() in this way. We have to use slightly different syntax in delete.asp to dispose the object so that it will generate the {</form>} tag.
|
||||
# C# supports anonymous class and object initializer. VBScript does not have equivalent syntax. So our code in Dinner/RSVPStatus.asc is slightly longer. Note that we use the imports statement at the beginning to import the namespace so that we can instantiate the AjaxOptions object later. We want to come out with our own anonymous class.
|
||||
|
||||
## Built-in objects in ASP page when used as ASP.NET MVC view
|
||||
|
||||
The following are the built-in objects supported in the ASP view pages:
|
||||
* context - HttpContext
|
||||
* request - HttpRequest
|
||||
* session - Session wrapper
|
||||
* server - Server wrapper
|
||||
* application - Application wrapper
|
||||
* response - Response wrapper
|
||||
* writer - TextWriter. Same as the TextWrite in webform view.
|
||||
* viewcontext - ViewContext. Same as the webform view.
|
||||
* viewdata - ViewDataDictionary. Same as the webform view.
|
||||
* model - Model. Same as the webform view.
|
||||
* tempdata - TempDataDictionary. Same as the webform view.
|
||||
* ajax - AjaxHelper. Same as the webform view.
|
||||
* html - HtmlHelper. Same as the webform view.
|
||||
* url - UrlHelper. Same as the webform view.
|
||||
|
||||
## Include ASP view engine.
|
||||
|
||||
It is fairly simply to use the ASP view engine:
|
||||
# Add reference to the dlls described in [Installation](Installation) in your ASP.NET MVC project.
|
||||
# In global.asax.cs, add {"using Dlrsoft.Asp.Mvc"}.
|
||||
# In Application_Start procedure, add {"ViewEngines.Engines.Add(new WebFormViewEngine());"}
|
||||
|
||||
The ASP view engine locate views in the views directory using the following patterms /Views/Controller/Action.asp and Views/Shared/Action.asp.
|
||||
|
||||
When locating partial views, the ASP view engine uses two additional patterns: /Views/Controller/Action.asc and Views/Shared/Action.asc.
|
53
readme.md
Normal file
53
readme.md
Normal file
|
@ -0,0 +1,53 @@
|
|||
## Project Description
|
||||
** This project is no longer actively maintained.**
|
||||
ASP Classic Compiler contains a VBScript compiler. It compiles ASP classic pages into a .NET Intermediate Language (IL) so that they can run inside the ASP.NET environment. This project allows ASP classic pages to coexist
|
||||
with ASP.net pages so that ASP Classic site owners can migrate to ASP.net page by page. As there are few ASP classic sites left, this project is no longer active. I had lots of fun working on the project, amongst them:
|
||||
- The project used ideas like call site caching (also called polymophic inline cache). It is about twice as fast as Microsoft VBScript interpreter.
|
||||
- I also experimented with type inference and applied it to string concatenation, something often seen in ASP classic code, using StringBuilder. The result is that some pages render hundreds times faster.
|
||||
- I was awarded Microsoft ASP.NET MVP 4 times from 2010-2014 and got to chance to meet many new people and make new friends.
|
||||
|
||||
3/30/2014 Converted the source control from Mercurial to Git. Added examples on DateTime usage.
|
||||
4/10/2011 Uploaded unit testing framework. Documents to appear in my blog.
|
||||
**3/29/2011. Open the source code under the Apache 2.0 license. See [announcements](http://weblogs.asp.net/lichen/archive/2011/03/30/asp-classic-compiler-is-now-open-source.aspx).**
|
||||
Build 0.6.2.34834 uploaded on 04/04/2010. Fixed a few bugs. See [History](docs/History.md) for more details.
|
||||
Build 0.6.1.34834 uploaded on 03/27/2010. Fixed a few bugs.
|
||||
Build 0.6.0.34834 uploaded on 12/18/2009. It works with FMStocks 1.0 now. See [this blog entry](http://weblogs.asp.net/lichen/archive/2009/12/20/asp-classic-compiler-0-6-0-released-it-can-run-fmstocks-1-0.aspx) for more details
|
||||
Build 0.5.7.34834 uploaded on 12/03/2009. Fixed numerous little bugs.
|
||||
Build 0.5.6.34834 uploaded on 11/30/2009. Fixed numerous little bugs.
|
||||
Build 0.5.5.34834 uploaded on 11/16/2009. This version has significant enhancements on error reporting.
|
||||
Build 0.5.4.34834 uploaded on 11/2/2009. Built with DLR 0.92. VS2010 and Silverlight build are available now.
|
||||
Build 0.5.3.32871 uploaded on 10/25/2009. This build supports Windows Azure, variable initializer and extension operators.
|
||||
Build 0.5.2.32072 uploaded on 10/17/2009. This build supports using asp classic compiler as an ASP.NET MVC ViewEngine.
|
||||
|
||||
## Project Detail
|
||||
|
||||
ASP Classic Compiler is based on our VBScript compiler (sorry, no JScript at this time) that compiles VBScript into a .NET executable. The compiler host is implemented as an ASP.NET handler. The VBScript compiler is based on a hand-written parser and uses Microsoft [Dynamic Language Runtime](http://www.codeplex.com/dlr) to generate the IL.
|
||||
|
||||
This project has two goals:
|
||||
|
||||
# High backward compatibility. The goal is to be able to run the majority of real world ASP pages under ASP.NET unmodified. This will provide a far smoother experience for migrating ASP Classic to ASP.NET. Currently, most ASP projects have to be migrated as a whole because ASP Classic and ASP.NET do not share states. ASP Classic Compiler will run ASP pages under the context of ASP.NET so they share the same state and security. This allows projects to be migrated page by page.
|
||||
# CLR interoperability. For those who need a scripting language like VBScript, we intend to an a minimum set of new syntax constructs so that it can interoperate with .NET classes without registering these classes as COM.
|
||||
|
||||
Please visit the [Features](docs/Features.md) page for features and limitations. If you encounter an incompatibility, do no modify your page yet. Instead, use Issue Tracker to post bugs and feature requests. Take a vote so that we know the priorities. It is our goal to run most real-world ASP pages without modification.
|
||||
|
||||
## Typical scenarios to use ASP Classic Compiler
|
||||
|
||||
# When you need to run ASP and ASP.NET side-by-site, ASP Classic Compiler runs your pages inside the ASP.NET runtime. You can migrate page by page and take advantage of the ASP.NET infrastructure immediately.
|
||||
# When you want to run ASP pages faster, ASP Classic Compiler runs the same page up to a few times faster using the latest technology in Dynamic Language Runtime. Pages can run even faster if they are modified to use ASP.NET cache and .NET StringBuilder.
|
||||
# When you run ASP in Cassini (the built-in web server in ASP.NET), ASP Classic Compiler is the only solution to run ASP pages inside Cassini.
|
||||
# Windows Azure application in the cloud, as it is an ASP.NET application. Windows Azure does not support ASP Classic. You can run php but you have to run it in full-trust. ASP Classic Compiler can run in standard partial-trust since it is just another ASP application. You can even deploy pages to Azure storage so that you do not need to repackage your application to deploy a change.
|
||||
# As view in ASP.NET MVC. Since ASP tends to generate html directly, it is more natural to migrate ASP pages to ASP.NET MVC than ASP.NET WebForms. We will provide a view engine so that the ASP Classic Compiler can be used as a view engine for ASP.NET MVC.
|
||||
# As the template engine for a code generator. The ASP Classic Compiler can be hosted anywhere from a console to a GUI application. We run ASP Classic Compiler in our unit testing project.
|
||||
# When you want to deploy a dynamic website on a read-only media/devices, it is possible to package ASP Classic Compiler with an embedded web server (e.g. Cassini) and database (e.g., SQL Server Compact edition) to run from a CD-ROM. ASP Classic Compiler generates code in memory. Users can run it when logging into the standard user account without requiring elevated privileges. .NET 2.0 is the only thing that needs to be preinstalled. IIS is not needed.
|
||||
|
||||
Have fun!
|
||||
|
||||
## Related Pages:
|
||||
[Features](docs/Features.md)
|
||||
[Installation](docs/Installation.md)
|
||||
[FAQ](docs/FAQ.md)
|
||||
[History](docs/History.md)
|
||||
[ASP View Engine for ASP.NET MVC](docs/Port-NerdDinner-Sample-to-ASP-View-Engine.md)
|
||||
[Contact](docs/Contact.md)
|
||||
[Acknowledgements](docs/Acknowledgements.md)
|
||||
[Contributors](docs/Contributors.md)
|
Loading…
Add table
Add a link
Reference in a new issue