[Mono-list] f# script got DllNotFoundException
Rodrigo Kumpera
kumpera at gmail.com
Thu May 21 16:30:56 UTC 2015
It works on mono 4.0.1, just upgrade.
On Wed, May 20, 2015 at 5:56 PM, fatboy <1599023866 at qq.com> wrote:
> 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 FSI_0001+down at 11.Invoke (Microsoft.FSharp.Core.Unit unitVar)
> [0x00000] in <filename unknown>:0
> at 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
> 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 ...
>
> _______________________________________________
> Mono-list maillist - Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-list/attachments/20150521/5cd2d087/attachment.html>
More information about the Mono-list
mailing list