Aplikacje Windows Store i F #
Próbuję utworzyć przenośną bibliotekę za pomocą F #, aby korzystać z aplikacji Windows Store. Stworzyłem jeden plik fs z jedną klasą:
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
}
Odwołałem się do tej biblioteki w mojej aplikacji Windows Store bez żadnych problemów. Ale problem polega na tym, że nie mogę uzyskać dostępu doFunctionalRT
moduł aniWebHelper
klasa. Kiedy piszęusing FunctionalRT
lub spróbuj użyćFunctionalRT.WebHelper.FunctionalRT
kompilator skarży się, że go nie zna. Jaki może być problem?
EDYTOWAĆ: Po kilku buidach i sprzątaniu dostaję
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
EDYTOWAĆ:
Dodawanie odniesienia doC:\Program Files (x86)\MSBuild\..\Reference Assemblies\Microsoft\FSharp\3.0\Runtime\.NETPortable\FSharp.Core.dll
rozwiązałem powyższy komunikat o błędzie, ale jest inny
Cannot await 'Microsoft.FSharp.Control.FSharpAsync<string>'