I am trying to create a portable library using F# to use with Windows Store apps. I created one fs file with one class:
module FunctionalRT
open System.Net
open System.IO
type WebHelper =
static member DownloadStringAsync (url:string) = async {
let req = HttpWebRequest.Create(url)
use! resp = req.AsyncGetResponse()
use stream = resp.GetResponseStream()
let reader = new StreamReader(stream)
let s = reader.ReadToEnd()
return s
}
I referenced this library in my Windows Store app with no problems. But the problem is, I cannot access the FunctionalRT
module neither the WebHelper
class. When I write using FunctionalRT
or try to use FunctionalRT.WebHelper.FunctionalRT
, the compiler complains it does not know it. What may be the problem?
EDIT: After a few buidls and cleans I get
The type 'Microsoft.FSharp.Control.FSharpAsync`1<T0>' is defined in an assembly that is not referenced. You must add a reference to assembly 'FSharp.Core, Version=2.3.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. C:\Users\Igor\Documents\Visual Studio 2012\Projects\App3\App3\GroupedItemsPage.xaml.cs 46 13 App3
EDIT:
Adding a reference to C:\Program Files (x86)\MSBuild\..\Reference Assemblies\Microsoft\FSharp\3.0\Runtime\.NETPortable\FSharp.Core.dll
solved the above error message, but there is another one
Cannot await 'Microsoft.FSharp.Control.FSharpAsync<string>'