Running .Text on ASP.NET 2.0
I finally managed to get .Text working with ASP.NET 2.0. Here's how:
- Add the following to the httpHandlers section of Web.config:
<
add verb="*" path="*.aspx" type="Dottext.Common.UrlManager.UrlReWriteHandlerFactory,Dottext.Common" />
- Change the method ProccessHandlerTypePage in the Dottext.Common.UrlManager.UrlReWriteHandlerFactory class. The documentation states that the GetCompiledPageInstance method “supports the .NET Framework infrastructure and is not intended to be used directly from your code.“ Hence, they obviously allowed themselves to change the behavior of this method. The first parameter is supposed to be “the virtual path to the requested file,“ but when you point it to an existing file, that is different from the actual one you want compiled, it processes it instead. I'm not sure this is the right way to do this, though, but it seems to work:
return
PageParser.GetCompiledPageInstance(pagepath.Substring(pagepath.LastIndexOf('\\') + 1), pagepath, context);
- Additional (nonmandatory) changes I made:
- Migrating the database to SQL 2005 (Importatnt note: when you use sp_attach_db [no SQL Express Manager yet] to connect the database, it will convert it to a new format, and you will not be able to attach it to a SQL 2000 server anymore. So create a backup prior to attaching.)
- Changing all the System.Collections classes to their equivalent System.Collections.Generic classes (and removing all unnecessary casts) for better performance.
- Moving from the code-behind scheme of ASP.NET 1.0/1.1 to partial classes.
I may post the code at the .Text workspace when I get the time to finish it.