Compartilhar via


F# on Silverlight 4

Earlier this week we have released F# runtime for Silverlight 4 as part of Microsoft Silverlight 4 Tools for Visual Studio 2010 (this is a single download that contains everything you need to develop for Silverlight for under VS2010).

Download Microsoft Silverlight 4 Tools for Visual Studio 2010, including F# runtime

The recommended way to develop in F# for Silverlight is to write a front-end
of your application in C# or VB, using the amazing UI authoring tools that are
available for those languages in Visual Studio, and code your computations or
data processing logic in F#. Brian has posted
a nice walkthrough that explains how to do this in detail
.

However, being an F# fan as I am, I like to write everything in F#!
With F# succinctness and clarity, I find coding UI logic in F# a very pleasant
and satisfying experience. There is one problem with it though - setting up a
project for Silverlight application in F# is a bit of a pain; so I ended up
writing a little Visual Studio template for F#-only (plus a bit of a XAML of
course) Silverlight app:

Download
F# Silverlight Application template

The experience is somewhat rough today:

  • 'Run' does not work seamlessly -  you will need to manually open
    Testpage.html from the output folder in your browser
  • The XAML designer occasionally crashes, in a soft way though - clicking on a
    reload link helps

But it will hopefully give you a starting point.

This posting is provided "AS
IS" with no warranties, and confers no rights.