Thursday, September 02, 2004

Cassini - alternate web server for ASP .NET

I am bugged with IIS, which I have keep shutting down and restarting or some times, reconfigre... So I found Cassini which is written in C# and which is free. This edition comes with Borland Delphi 8.0 and I am using it now.

you can download it from the below link Cassini download link

Here is - how to...

Cassini comes with Delphi 8, and it's code can be found in Demo folder of BDS installation. There is a Build.bat file which builds the project and creates the server EXE.

The only problem is that the build assumes that you have both the .Net framework's and the .Net SDK's \bin directory on your path. So, you can either manually follow the steps in the build.bat file or you can add these two paths to your Environment's PATH: (use Windows + Break key to launch System Properties -> go to Advanced tab and click on Envirnoment variables to update the PATH variable

C:\WINNT\Microsoft.NET\Framework\v1.1.4322
C:\Program Files\Microsoft.NET\SDK\v1.1\Bin

Your paths may vary slightly -- these are the paths on my machine as a result of the default installation locations. Now if you run build.bat, it will compile and register the Cassini server. Cassini actually requires command line parameters to run, but the IDE takes care of all of that for you.

Then, once you have Cassini built, you can add it into the IDE. Go to Tools|Options and select ASP.NET in the treeview on the left. Then, in the 'Cassini Web Server' group box, use the Browse button to navigate to the EXE for Cassini that you created above, and select it. You can change the default port for Cassini if you like, but the default of 8080 is probably fine.

All set to run ASP .NET using Cassini now. Create a new ASP .NET project in Delphi and the wizard will have Cassini selected, compile and run, every thing should run smoothly!