If the reason for the exception is because the table already exists, why not use BeginCreateTableIfNotExist / EndCreateTableIfNotExist .
UPDATE:
The error has nothing to do with Windows Azure. I can reproduce the same behavior with a simple program:
open System open System.Windows.Forms let bufferData = Array.zeroCreate<byte> 100000000 let async1 filename = async{ try use outputFile = System.IO.File.Create(filename) do! outputFile.AsyncWrite(bufferData) MessageBox.Show("OK") |> ignore with | :? ArgumentException -> printfn "Failed with ArgumentException"; MessageBox.Show("Failed with ArgumentException") |> ignore | _ -> printfn "Failed with unknown exception"; MessageBox.Show("Failed with unknown exception") |> ignore } |> Async.Start let main(args) = let form = new Form(Text = "Test Form") let button1 = new Button(Text = "Start") let button2 = new Button(Text = "Start Invalid", Top = button1.Height + 10) form.Controls.AddRange [| button1; button2; |] button1.Click.Add(fun args -> async1 "longoutput.dat")
It is strange that the code works fine in F # Interactive, but it is not possible to catch exceptions when debugging a Windows application inside Visual Studio (it does not matter if you debug or configure Release). Even a stranger, it works great if run as an application outside of Visual Studio.
In case you are interested, this program is adapted from the MSDN example , which shows the same problem.
UPDATE 2:
A similar question was asked at http://cs.hubfs.net/topic/Some/0/59516 . As @ildjarn and @Brian noted, this bug was fixed in VS2010 SP1. Without VS2010 SP1, you can also test your code with F # Interactive and run the application outside of VS without any problems.
source share