[Mono-list] F# script got DllNotFoundException

fatboyzz 1599023866 at qq.com
Wed May 20 21:47:01 UTC 2015

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()

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
  at System.Net.WebRequest.GetDefaultWebProxy () [0x00000] in <filename
  at System.Net.WebRequest.get_DefaultWebProxy () [0x00000] in <filename
  at System.Net.GlobalProxySelection.get_Select () [0x00000] in <filename
  at System.Net.HttpWebRequest..ctor (System.Uri uri) [0x00000] in <filename
  at (wrapper remoting-invoke-with-check) System.Net.HttpWebRequest:.ctor
  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 FSI_0001+down at 11.Invoke (Microsoft.FSharp.Core.Unit unitVar) [0x00000]
in <filename unknown>:0
Microsoft.FSharp.Control.AsyncBuilderImpl+callA at 805[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit].Invoke
(Microsoft.FSharp.Control.AsyncParams`1 args) [0x00000] in <filename

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.

More information about the Mono-list mailing list