Hmmm - my error this still doesn't make sense because of course it is
the correct 1.0.0.0 version of Raven.Client.Lightweight that's in the
1.0.888 release.
I then tried to run the script straight out of the Raven client
directory on the downloaded binary distribution - so all required dlls
are in the directory from which the script runs, and still I get an
error to say it can't find the raven.client.lightweight.dll.
So I then tried an experiment and copied the
Raven.Client.Lightweight.dll into the core F# v4.0 framework
directory: C:\Program Files (x86)\Microsoft SDKs\F#\3.0\Framework\v4.0
and this time the error changed to this:
System.ArgumentException: Incorrect instance type
Parameter name: obj
at Microsoft.FSharp.Quotations.PatternsModule.checkObj(MemberInfo
membInfo, FSharpExpr obj)
at
Microsoft.FSharp.Quotations.PatternsModule.mkInstanceMethodCall(FSharpExpr
obj, MethodInfo minfo, FSharpList`1 args)
at
Microsoft.FSharp.Quotations.ExprShapeModule.RebuildShapeCombination(Object
shape, FSharpList`1 arguments)
at Microsoft.FSharp.Linq.QueryModule.walk@861-1[a](FSharpFunc`2 f,
FSharpExpr p)
at Microsoft.FSharp.Li...@861-2.Invoke(FSharpExpr
p)
at Microsoft.FSharp.Primitives.Basics.List.map[T,TResult]
(FSharpFunc`2 mapping, FSharpList`1 x)
at Microsoft.FSharp.Linq.QueryModule.walk@861-1[a](FSharpFunc`2 f,
FSharpExpr p)
at Microsoft.FSharp.Li...@861-2.Invoke(FSharpExpr
p)
at Microsoft.FSharp.Primitives.Basics.List.map[T,TResult]
(FSharpFunc`2 mapping, FSharpList`1 x)
at Microsoft.FSharp.Linq.QueryModule.walk@861-1[a](FSharpFunc`2 f,
FSharpExpr p)
at Microsoft.FSharp.Li...@861-2.Invoke(FSharpExpr
p)
at Microsoft.FSharp.Primitives.Basics.List.map[T,TResult]
(FSharpFunc`2 mapping, FSharpList`1 x)
at Microsoft.FSharp.Linq.QueryModule.walk@861-1[a](FSharpFunc`2 f,
FSharpExpr p)
at Microsoft.FSharp.Linq.QueryModule.EvalNonNestedInner(FSharpExpr
queryProducingSequence)
at Microsoft.FSharp.Linq.QueryModule.EvalNonNestedOuter(FSharpExpr
tm)
at <StartupCode$FSI_0004>.$FSI_0004.main@()
The test code (I'm running this straight out of the RavenDB client
directory, hence the comment mark on the include) is:
//#I @"C:\Extras\RavenDB-Build-888\Client"
#r "Newtonsoft.Json.dll"
#r "NLog"
#r "Raven.Client.Lightweight.dll"
//#r "Raven.Abstractions.dll" // do I need this?
#r "Raven.Client.Lightweight.FSharp.dll"
type Movie =
{
Id:string
Title:string
Summary:string
}
// let's try the new F# 3 linq syntax...
let store = new Raven.Client.Document.DocumentStore()
store.Url <- "
http://localhost:8080/"
store.Initialize() |> ignore
let session = store.OpenSession()
open System.Linq
open Microsoft.FSharp.Linq
// try something with our movies collection
query { for item in session.Query<Movie>() do
select item
}