New Version of Phalanger with Silverlight and VS 2008 Support

At the Lang.NET Symposium I presented several new features in Phalanger. I already posted the presentation and samples on the blog (here) and the talk is also available as a video on the Lang.NET web site (here - actually, due to the huge demand the site is down now, but I hope it gets back soon!) Anyway, the most interesting thing is that I've used Phalanger Integration for Visual Studio 2008 during the talk, which wasn't available in any Phalanger release until now.

I have to mention one more thing before talking more about the new release - Phalanger Integration for VS 2008 works with Visual Studio Shell, which means that you can get Visual Studio 2008 with Phalanger Support for free! Yes, that's right. Microsoft offers so called Visual Studio 2008 Shell, which is an "empty" IDE with no integrated languages and you can install Phalanger Integration into this version, which means that you can get very good Phalanger IDE (for Windows) for no cost at all!

If you can't wait to install this new version, you can skip the overview article and go directly to the installation links.

What's new in this release?

The two most important things in this release is a support for Visual Studio 2008 and support for Silverlight 1.1. Both features are still evolving, so there are some issues, but I believe that both things are really important and so we'd like to make them available as a release, so you can play with them without the need to compile whole Phalanger from the source code.

Regarding the Silverlight support - Microsoft released a new version (and also renamed this version 1.1 to 2.0, so don't feel confused :-)) a few days ago, which means that Phalanger currently supports only the older version. We're of course switching to the new version after this release (which was also a reason for releasing some version of Phalanger for Silverlight now), but it will likely take some time to update everything. Version 2.0 (beta 1) of Silverlight has a plenty of new features, but I believe that you can still do some very interesting things with the version 1.1 (alpha) and I also hope that my presentation at Lang.NET demonstrated this :-). Anyway, here is a short list of key new features:

  • Visual Studio 2008 support including the FREE "Shell" version. The Figure 1 demonstrates how the "New Project" dialog looks after installing Phalanger in the "Shell" version of Visual Studio, the Figure 2 shows "New Web Site" dialog in the same configuration. As you can see, there are no other languages available in the dialog windows, because we're using the free "Shell" version. If you install Phalanger in other version of Visual Studio (Professional, etc..) it will be, of course, integrated as one of the languages:
    New Phalanger Project
    Figure 1: New Phalanger Project in VS 2008
    New Phalanger Web Site
    Figure 2: New Phalanger Web Site in VS 2008
  • Silverlight 1.1 (alpha) support including new project templates for Silverlight. After selecting "New Web Site.." in the dialog box and "Phalanger Silverlight Web" as a template you should get something like the project at Figure 4. As you can see, we're using a different extension for Silverlight PHP scripts (phpx), because web server needs to be configured to publish these scripts as plain-text, rather than executing them on the server (as in usual PHP server-side web). This is quite similar to how JavaScript works, but it of course requires installation of Silverlight.
    Silverlight Project
    Figure 4: Silverlight Project in PHP
  • Windows Forms Designer is now supported in Visual Studio 2008. Thanks to our new contributor Jan Z├íruba, we also have a support for Windows Designer now! This means that you can use Phalanger to develop programs that run as a windowed applications (and note that WinForms is also supported on Mono, so this isn't limited only to Windows platform). There are still a few limitations (i.e. we don't compile resources correctly and the generated code doesn't use partial classes yet (which means that the generated code is mixed in one file with the code that you write by hand), but it still saves you a lot of work. The following screenshot demonstrates some of the .NET 2.0 controls in a PHP application created using the designer:
    Windows Forms Project
    Figure 3: Windows Forms Project in PHP
  • Debugging of Silverlight applications. Finally, the new version also supports debugging of Silverlight applications. This is especially useful when you're working on Silverlight app that connects back to the server. This can be done using HTTP request and PHP makes this easier via fopen("http://...") calls. In this case you can place breakpoints in both client-side code (phpx file, running as Silverlight) and server-side code (php file, running using Phalanger). You can of course use standard PHP on the server-side if you wish, but the debugging of server-side code works only when Phalanger is used.

Phalanger for Visual Studio 2008 Downloads

If you don't have any version of Visual Studio, you'll need to install Visual Studio 2008 Shell [1] first. Make sure that you're installing the "integrated mode", which allows installation of new programming languages (like Phalanger). After installing Phalanger you may optionally install Silverlight 1.1 Tools [2]. It will allow debugging of Silverlight PHP applications, but it is not needed if you don't need debugging - you'll still be able to develop and run Silverlight apps. Also note that this is an alpha version, so it may cause some issues. In my case, it worked very well and debugging is quite useful! After installing these two pre-requisites, you can install Phalanger [3] (note that you need the most recent version, to be able to use Visual Studio 2008 Integration), and finally you can install Visual Studio Integration package [4].


Discuss on twitter, .
Send corrections via GitHub pull requests.