Prior ASP.NET 4.0, the only way to handle extensionless URLs was setting runAllManagedModulesForAllRequests=”true” (IIS 7 integrated mode) or mapping a wildcard (IIS 6 and IIS 7 in classic mode). That impacts the performance of static requests (HTML, JPG, GIF, CSS, JS, etc), because a all requests are handled by ASP.NET and runs application pipeline with all attached modules.
ASP.NET v4.0 provides a better way to enable extensionless URLs routing.
There is a new feature that allows extensionless URLs to be directed into managed code, without a wildcard mapping or setting runAllManagedModulesForAllRequests=”true”.
Because of this feature all static resources requests are not longer handled by ASP.NET, and consequentially, they are no longer suffered by performance impact.
It works by default on IIS 6. You may read more about this feature on IIS 6 here .
But IIS 7 surprises a lot! It does not support this feature by default, and I spend an hours to find solution.
The solution is called IIS 7 QFE and steps to download it can be found at http://support.microsoft.com/kb/980368.
I don't know why they did not supply this with .NET 4 installation, they know it better.
Wednesday, February 16, 2011
Monday, November 22, 2010
Configuring IronPython CGI on IIS 7
This guide walks you through configuring IronPython CGI on IIS 7.
Sunday, November 21, 2010
Write custom ASP.NET HTTP Handler with IronPython
An HTTP handler is the endpoint that responds to handle request made by an ASP.NET Web application. The request is mapped to HTTP handler based on name pattern (commonly file extension). ASP.NET provides a few default HTTP handlers: Page handler (.aspx), Web Service handler (.asmx), Generic handler (.ashx) and so forth.
ASHX Generic handler is special since it allows to implement IHttpHandler API immediately.
There is a sample - HelloWorld.ashx:

Language attribute allows me to chose program language to use, but it strongly limited by only two - C# and VB. What if I want to write my code in Python?
ASHX Generic handler is special since it allows to implement IHttpHandler API immediately.
There is a sample - HelloWorld.ashx:

Language attribute allows me to chose program language to use, but it strongly limited by only two - C# and VB. What if I want to write my code in Python?
Friday, November 19, 2010
Write ASP.NET MVC using IronPython - Resources
I started research of using IronPython on ASP.NET MVC.
There are resources I found helpful:
Official Site: http://ironpython.net/ (download links are not up to date)
Downloads: http://ironpython.codeplex.com/
ASP.NET Dynamic Language Support: http://aspnet.codeplex.com/wikipage?title=Dynamic%20Language%20Support&referringTitle=Home&ProjectName=aspnet
IronPython integration with ASP.NET, No support for ASP.NET MVC (at least for now, seems they did support ASP.NET MVC in the past)
The New Dynamic Language Extensibility Model for ASP.NET: http://www.asp.net/dynamiclanguages/whitepaper
Write ASP.NET MVC application in Ruby: https://github.com/jschementi/ironrubymvc (not Python, but similar to my target)
Using IronPython in ASP.NET MVC: http://www.codevoyeur.com/Articles/Tags/ironpython.aspx
A Simple IronPython ControllerFactory for ASP.NET MVC
A Simple IronPython ActionFilter for ASP.NET MVC
A Simple IronPython Route Mapper for ASP.NET MVC
An Unobtrusive IronPython ViewEngine for ASP.NET MVC
The last links seem to be worthiest
The next step is starting simple ASP.NET MVC application with IronPython.
There are resources I found helpful:
Official Site: http://ironpython.net/ (download links are not up to date)
Downloads: http://ironpython.codeplex.com/
ASP.NET Dynamic Language Support: http://aspnet.codeplex.com/wikipage?title=Dynamic%20Language%20Support&referringTitle=Home&ProjectName=aspnet
IronPython integration with ASP.NET, No support for ASP.NET MVC (at least for now, seems they did support ASP.NET MVC in the past)
The New Dynamic Language Extensibility Model for ASP.NET: http://www.asp.net/dynamiclanguages/whitepaper
Write ASP.NET MVC application in Ruby: https://github.com/jschementi/ironrubymvc (not Python, but similar to my target)
Using IronPython in ASP.NET MVC: http://www.codevoyeur.com/Articles/Tags/ironpython.aspx
A Simple IronPython ControllerFactory for ASP.NET MVC
A Simple IronPython ActionFilter for ASP.NET MVC
A Simple IronPython Route Mapper for ASP.NET MVC
An Unobtrusive IronPython ViewEngine for ASP.NET MVC
The last links seem to be worthiest
The next step is starting simple ASP.NET MVC application with IronPython.
Friday, October 22, 2010
IZWebFileManager 2.6.2 release is out
Hi there!
I released IZWebFileManager 2.6.2 which has two new features:
1. Now is goes with French translation - thanks a lot to Cédric Mousset who did it.
2. New property EnableContextMenu. I was asked about this at forum: http://www.izwebfilemanager.com/forums/thread/591.aspx
You may disable context menu in the file list by setting this property false (it is true by default)
Disabling the context menu will not automatically prevent an actions (such delete file or create new folder). It affects UI only. If you need to disable/cancel an action you have to handle proper event (for example SelectedItemsAction of NewFolderCreating) and cancel the action by setting Cancel=true of event argument.
The release is available for download from Google Code
https://code.google.com/p/izwebfilemanager/
I released IZWebFileManager 2.6.2 which has two new features:
1. Now is goes with French translation - thanks a lot to Cédric Mousset who did it.
2. New property EnableContextMenu. I was asked about this at forum: http://www.izwebfilemanager.com/forums/thread/591.aspx
You may disable context menu in the file list by setting this property false (it is true by default)
Disabling the context menu will not automatically prevent an actions (such delete file or create new folder). It affects UI only. If you need to disable/cancel an action you have to handle proper event (for example SelectedItemsAction of NewFolderCreating) and cancel the action by setting Cancel=true of event argument.
The release is available for download from Google Code
https://code.google.com/p/izwebfilemanager/
Sunday, August 8, 2010
IZWebFileManager 2.6.1 release is out
I am very happy to announce that IZWebFileManager 2.6.1 has been released.
The main feature of this release is support of applications running in "Medium Trust" environment.
I added following <trust level="Medium"></trust> directive in Demo's web.config to enforce security restrictions when you run it.
The release is available for download from Google Code
https://code.google.com/p/izwebfilemanager/
The main feature of this release is support of applications running in "Medium Trust" environment.
I added following <trust level="Medium"></trust> directive in Demo's web.config to enforce security restrictions when you run it.
The release is available for download from Google Code
https://code.google.com/p/izwebfilemanager/
Wednesday, August 4, 2010
Running ASP+MySql on 64-bit Windows 7
I have a legacy ASP 3.0 application working with MySql 4 database via MySql ODBC 3.51 connector.
Currently it runs on Windows 2003 server (32-bit, IIS 6.0). Everything works fine.
Recently I was asked to make some changes in the application and I had to setup developing environment. Last time I did such setup it was 32-bit Windows XP and I had no problem. But time went by and today I am working with 64-bit Windows 7.
I started as usual by installing MySql ODBC 3.51 connector. Install ran smoothly and my next step was to configure proper data source in "ODBC Data Source Administrator" dialog box (Control Panel > Administrative Tools > Data Sources (ODBC)). But to my surprise opened dialog did not list MySql ODBC driver, so I was not able to configure it. Reinstalling the driver did not bring success. What's wrong I did?!?!
After searching internet (thanks Google) I found solution: "To manage a data source that connects to a 32-bit driver under 64-bit platform, use c:\windows\sysWOW64\odbcad32.exe. To manage a data source that connects to a 64-bit driver, use c:\windows\system32\odbcad32.exe." Can you imagine that?
I ran c:\windows\sysWOW64\odbcad32.exe and got the same "ODBC Data Source Administrator" dialog box but now with ability to configure my data source.
Next step was to set up IIS 7.0 to run ASP 3.0 application. It was relatively easy so I will omit the details.
At this step I was pretty sure that my application will run properly, but the first request returns error: "The specified DSN contains an architecture mismatch between the Driver and Application". The same question - What's wrong I did?!?!
Searching again (What would we do without Google?) . Luckily I am not only one who has such a problem. The solution is to configure web application to run in a 32-bit application pool. There is no direct way to run a 32-bit in-process components from a 64-bit application pool.
Now I got my application runs!
Currently it runs on Windows 2003 server (32-bit, IIS 6.0). Everything works fine.
Recently I was asked to make some changes in the application and I had to setup developing environment. Last time I did such setup it was 32-bit Windows XP and I had no problem. But time went by and today I am working with 64-bit Windows 7.
I started as usual by installing MySql ODBC 3.51 connector. Install ran smoothly and my next step was to configure proper data source in "ODBC Data Source Administrator" dialog box (Control Panel > Administrative Tools > Data Sources (ODBC)). But to my surprise opened dialog did not list MySql ODBC driver, so I was not able to configure it. Reinstalling the driver did not bring success. What's wrong I did?!?!
After searching internet (thanks Google) I found solution: "To manage a data source that connects to a 32-bit driver under 64-bit platform, use c:\windows\sysWOW64\odbcad32.exe. To manage a data source that connects to a 64-bit driver, use c:\windows\system32\odbcad32.exe." Can you imagine that?
I ran c:\windows\sysWOW64\odbcad32.exe and got the same "ODBC Data Source Administrator" dialog box but now with ability to configure my data source.
Next step was to set up IIS 7.0 to run ASP 3.0 application. It was relatively easy so I will omit the details.
At this step I was pretty sure that my application will run properly, but the first request returns error: "The specified DSN contains an architecture mismatch between the Driver and Application". The same question - What's wrong I did?!?!
Searching again (What would we do without Google?) . Luckily I am not only one who has such a problem. The solution is to configure web application to run in a 32-bit application pool. There is no direct way to run a 32-bit in-process components from a 64-bit application pool.
Now I got my application runs!
Subscribe to:
Posts (Atom)