f# - FSharp.Data 'System.MissingMethodException' when calling Freebase Provider from C# -
hi have piece of code on f#, if test f# interactive editor both ispalindrome , extract methods work well:
namespace portable3 open fsharp open fsharp.data open microsoft.fsharp.linq open fsharp.data.freebaseoperators open mytrip.model.mytrip open mytrip.model.freebase open system.runtime open system.linq module math = let ispalindrome (str : string) = let rec check(s : int, e : int) = if s = e true elif str.[s] <> str.[e] false else check(s + 1, e - 1) check(0, str.length - 1) [<autoopen>] module extractor = [<literal>] let freebaseapikey = "aizasyco31ls" type freebasedatawithkey = freebasedataprovider<key=freebaseapikey> let extract mid = let datawithkey = freebasedatawithkey.getdatacontext() let place = datawithkey.commons.travel.``travel destinations``.where( fun x-> x.machineid = mid) |> seq.tolist let result = new place() let firstplace = place.head result.name <- firstplace.name result
and call code c# console app this:
class program { static void main(string[] args) { //works var ispalin = math.ispalindrome("absba"); //fails var res = extractor.extract("/m/04jpl"); console.writeline(res); console.read(); } }
the console c# project .net framework 4.5.1 version, downloaded fsharp.data , fsharp.core on project also. when executing ispalindrome works when i'm execute extract method error appears:
an unhandled exception of type 'system.missingmethodexception' occurred in fsharpconsoletest.exe additional information: method not found: 'fsharp.data.runtime.freebase.freebasedatacontext fsharp.data.runtime.freebase.freebasedatacontext._create(system.string, system.string, system.boolean, system.string, system.boolean, system.boolean)'.
any idea on what's happening? searched on internet didn't found relevant. thanks!
the problem @ end using portable library fsharp.data. tried using in normal f# library , found no problems, had debuggin capabilities, , no errors c# integration f# happening!
Comments
Post a Comment