F# script got DllNotFoundException

fatboyzz <[email protected]>
Newsgroups gmane.comp.gnome.mono.general
Message-ID <[email protected]>
Mono JIT compiler version 4.0.0
OSX 10.9

I wrote a F# script to grab html page

/////////////////////////////////////////////////////////////////////////////////////////////////
#r "mscorlib.dll"
#r "System.dll"
#r "System.Core.dll"

open System
open System.IO
open System.Net

let down (uri : Uri) =
    async {
        let req = WebRequest.Create(uri)
        let! resp = req.AsyncGetResponse()
        let stream = resp.GetResponseStream()
        stream.CopyTo(Console.OpenStandardOutput())
    }

let page = new Uri("http://www.fsharp.org")

down page |> Async.RunSynchronously


///////////////////////////////////////////////////////////////////////
I run it with

fsharpi test.fsx


///////////////////////////////////////////////////////////////////////
and I got

System.DllNotFoundException: libc.dylib
  at (wrapper managed-to-native) System.Platform:uname (intptr)
  at System.Platform.CheckOS () [0x00000] in <filename unknown>:0
  at System.Platform.get_IsMacOS () [0x00000] in <filename unknown>:0
  at System.Net.WebRequest.GetSystemWebProxy () [0x00000] in <filename
unknown>:0
  at System.Net.WebRequest.GetDefaultWebProxy () [0x00000] in <filename
unknown>:0
  at System.Net.WebRequest.get_DefaultWebProxy () [0x00000] in <filename
unknown>:0
  at System.Net.GlobalProxySelection.get_Select () [0x00000] in <filename
unknown>:0
  at System.Net.HttpWebRequest..ctor (System.Uri uri) [0x00000] in <filename
unknown>:0
  at (wrapper remoting-invoke-with-check) System.Net.HttpWebRequest:.ctor
(System.Uri)
  at System.Net.HttpRequestCreator.Create (System.Uri uri) [0x00000] in
<filename unknown>:0
  at System.Net.WebRequest.Create (System.Uri requestUri) [0x00000] in
<filename unknown>:0
  at [email protected] (Microsoft.FSharp.Core.Unit unitVar) [0x00000]
in <filename unknown>:0
  at
Microsoft.FSharp.Control.AsyncBuilderImpl+callA@805[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit].Invoke
(Microsoft.FSharp.Control.AsyncParams`1 args) [0x00000] in <filename
unknown>:0


/////////////////////////////////////////////////////////////////////////
If I create new solution change code to compile version, everything works.
But I only want to write a script.
Need your help ...



--
View this message in context: http://mono.1490590.n4.nabble.com/F-script-got-DllNotFoundException-tp4666002.html
Sent from the Mono - General mailing list archive at Nabble.com.
_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.