How To Install and Setup FluorineFX in Visual Studio 2008
Setup and Test FluorineFX and Flex with IIS
I have been doing a lot of .Net development of late. I only use C# because I came from a Java world and C# was a natural fit. They both have a common ancestry, of sorts. Anyway, VS2008 is a great environment for building all sorts of applications but I have trouble with ASP.Net. In my opinion, Microsoft is still desktop centric because their ASP.Net UI tooling (in my opinion) leaves a lot to be desired compared to their desktop offerings.
When I was developing Java applications I was using Adobe Flex to build great UI clients and coupling them with a solid Java back end. Not only did I provide a stellar user experience, I also had near desktop performance including for data transactions. Also Adobe Flex provided me with some truly RAD tools with their Eclipse based Flex Builder. So I started using Adobe Flex for the client portion of my .Net applications and .Net Web services written in C# for the back end. This was great but I sometimes longed for the performance I had with my Flex/Blazeds environment I had in Java.
So I started investigating other options and I came across this tool for the .Net environment. It provides me with a complete set of AMF compatible tools for the .Net environment, including of course Remote Objects and Messaging. What I like about FluorineFX is that everything is packaged in your .Net Solution and your application can be deployed as a standalone unit on your IIS server as opposed to say WebOrb where you have to deploy your application in the WebOrb root folder.
I am writing this article basically to show developers how to setup FluorineFX in Visual Studio 2008 and test your FluorineFX backend before building your Flex front end.
FluorineFX has a straightforward installation process you simply follow the prompts and save the installation to a convenient location. The installation process will configure your Visual Studio 2008 environment and add the following templates:
· FluorineFX Service Library
· FluorineFX ASP.Net Web Site
The FluorineFX Service Library template is used to create the back end (Remoting) portion of your application. The FluorineFX ASP.Net Web Site template as you might have guessed is used to create the front end container of your web site. I say container because this is where your will place your compiled Adobe Flex swif (.swf) application.
Create Bare Bones Application
Create a Solution
The steps to create a basic application are pretty straight forward. Start by creating a new Blank Solution in Visual Studio 2008.
File->Other Project Types->Visual Studio Solutions
I am going to call my solution “TextFluorine” but you can name yours anything you want.
Create FluorineFX Project
Next right click on your Solution in the Solution Explorer and from the context Menu add a new Project
Under the Visual C# heading, select the “FluorineFX ServiceLibrary” template. For this basic test I named my Project “TestFluorineProject” and select “Add to Solution”. Click OK to create the project structure in your solution.
This template will create a simple class library with a basic class called “Sample.cs”. It adds an “Echo” method that we will use later to test our Basic Setup.
Create FluorineFX Web Site
After this I am going to create a FluorineFX web site in my solution. Again right click on the solution heading in the Solution Explorer and add a web site.
Add->New Web Site
From the “Add New Web Site” menu select the “FluorineFX ASP.Net Web Site”. Make sure the “File System” is selected for the location and the language is Visual C#. The web site can be created anywhere on your hard drive but I like to keep things together, especially when you are using a source control solution. By VS2008 doesn’t select your solution by default it tends to suggest creating the web site outside the solution folder. To remedy this, change the location path and add a name for your project.
I am going to name my “TestFluorineWeb”.
At this point your project structure should look like this in Visual Studio 2008. The solution has two projects, a web site and class library. It also added a reference to the FluorineFX engine.
Configure Run Configuration
Before we can run this application, you will need to set the start page and the start project
First right click on the “TestFluorineWeb” project (or whatever you name your web site) and select “Set as StartUp Project”.
Likewise right-click on the “Console.aspx” page and click “Set as Start Page”
Now we are ready to test the basic setup. From the menu select “Debug” and “Start Debugging F5” or simply press the “F5” key. If you get a message requesting to configure your application for debugging accept the default and click OK. Once your application is up and running, you should see the Console page.
Expand the “TestFluorineWeb” node until you see the Echo class and select it. In the Text field on the right side, enter “Hello World!!” or whatever you like and click on the “Call” button. You will see the results under the Results tab as below