Missing DLL exception in F # Script loading from Azure CosmosDb

I am trying to test some different requests in an F # script file against my Azure CosmosDb, but I get an error message regarding a missing DLL when I try to execute the request itself.

I load Documents.Client.dll:

#r "../packages/Microsoft.Azure.DocumentDB/lib/net45/Microsoft.Azure.Documents.Client.dll"
open Microsoft.Azure.Documents
open Microsoft.Azure.Documents.Client
open Microsoft.Azure.Documents.Linq

But when I execute the request:

Seq.toList <| query {
            //some query that I copy & pasted from a working file
        }

I get this error:

System.AggregateException: One or more errors occurred. ---> System.DllNotFoundException: Unable to load DLL 'Microsoft.Azure.Documents.ServiceInterop.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
   at Microsoft.Azure.Documents.ServiceInteropWrapper.CreateServiceProvider(String configJsonString, IntPtr& serviceProvider)
   at Microsoft.Azure.Documents.Query.QueryPartitionProvider.Initialize()
   at Microsoft.Azure.Documents.Query.QueryPartitionProvider.GetPartitionedQueryExecutionInfoInternal(SqlQuerySpec querySpec, PartitionKeyDefinition partitionKeyDefinition, Boolean requireFormattableOrderByQuery, Boolean isContinuationExpected)
   at Microsoft.Azure.Documents.Query.DocumentQueryExecutionContextBase.<GetPartitionedQueryExecutionInfoAsync>d__0.MoveNext()

(there is more stack in the trace - this is just the top).

I can not find the dll ServiceInteropanywhere - it is not mentioned in any projects or in the folder of my packages, and this is not a link to nuget. I'm not sure what I would be missing to get this error only in F # Interactive.

Update

@tomislav-markovski, Microsoft.Azure.DocumentDB 1.13.2. dll ServiceInterop , F # interactive :

--> Referenced 'c:\VSTS\MyApplication\../packages/Microsoft.Azure.DocumentDB/lib/net45/Microsoft.Azure.Documents.Client.dll' (file may be locked by F# Interactive process)


Script.fsx(5,1): error FS0229: Error opening binary file 'c:\VSTS\MyApplication\../packages/Microsoft.Azure.DocumentDb/runtimes/win7-x64/native/Microsoft.Azure.Documents.ServiceInterop.dll': c:\VSTS\MyApplication\../packages/Micro
soft.Azure.DocumentDb/runtimes/win7-x64/native/Microsoft.Azure.Documents.ServiceInterop.dll: bad cli header, rva 0


Script.fsx(5,1): error FS3160: Problem reading assembly 'c:\VSTS\MyApplication\../packages/Microsoft.Azure.DocumentDb/runtimes/win7-x64/native/Microsoft.Azure.Documents.ServiceInterop.dll': Exception of type 'Microsoft.FSharp.Compiler.ErrorLogger+
StopProcessingExn' was thrown.

" ", , , VSCode, , F # Interactive . Service Interop:

#r "../packages/Microsoft.Azure.DocumentDb/runtimes/win7-x64/native/Microsoft.Azure.Documents.ServiceInterop.dll"

, ... , - DLL.

2

:

  • , Client.dll. "missing service interop dll".
  • , "ServiceInterop.dll". " ".
  • #I, DLL :

    #I "../packages/Microsoft.Azure.DocumentDB/lib/net45/"

    #r "Microsoft.Azure.Documents.Client.dll"

    " ServiceInterop.dll".

  • :

    Seq.toList <| query { for t in client.CreateDocumentQuery( documentCollectionUri()) do select t }

"missing ServiceInterop.dll". 5. FeedOptions " Cross Partiiton":

let feedOptions = FeedOptions()
feedOptions.EnableCrossPartitionQuery <- true
feedOptions.MaxItemCount <- 3 |> System.Nullable

Seq.toList <| query {
            for t in client.CreateDocumentQuery( documentCollectionUri(), feedOptions ) do
            select t
}

, . "missing ServiceInterop.dll".

+6

All Articles