[Mono-list] f# script got DllNotFoundException

fatboy 1599023866 at qq.com
Wed May 20 21:56:21 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()
         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 ...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-list/attachments/20150521/5b8ce36c/attachment-0001.html>


More information about the Mono-list mailing list