I am using Microsoft.Azure.DocumentDB 1.17.0 in my project and getting below error. "ServiceInterop.dll" Dll is present in the folder which has Microsoft.Azure.DocumentDB dll. But still getting below 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()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Documents.Query.DocumentQueryExecutionContextFactory.<CreateDocumentQueryExecutionContextAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Documents.Linq.DocumentQuery`1.<CreateDocumentQueryExecutionContextAsync>d__12.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at Microsoft.Azure.Documents.Linq.DocumentQuery`1.<GetEnumerator>d__b.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
I am getting same issue (although with Microsoft.Azure.DocumentDB.Core (1.7.1).
I have made this issue go away by installing the https://www.nuget.org/packages/Microsoft.Azure.DocumentDB/ nuget package.
PM> Install-Package Microsoft.Azure.DocumentDB -Version 1.19.1
Now on the same line I am getting error: Message: {"Errors":["An invalid query has been specified with filters against path(s) that are not range-indexed. Consider adding allow scan header in the request."]}
So, feels like essentially my query is somehow problematic, but that before I installed the framework nuget (and just had the core nuget), the library was not responding as gracefully to the error.
fwiw I've grepped my /c (window 10 c drive) and /z (mounted data drive where I have my source) - see here for where these dlls are now located.
OK, now onto fix the actual query!
Also, fwiw: According to this doc: https://docs.microsoft.com/en-us/azure/cosmos-db/sql-api-sdk-dotnet
1.11.0 Fix for automatic binplacing of Microsoft.Azure.Documents.ServiceInterop.dll and DocumentDB.Spatial.Sql.dll assemblies to application’s bin folder when using the Nuget package with projects that have project.json tooling.
1.9.2 Fixed the missing references to DocumentDB.Spatial.Sql.dll and Microsoft.Azure.Documents.ServiceInterop.dll that are required when referencing an Azure Cosmos DB project with a reference to the Azure Cosmos DB Nuget package.
which implies that this has been fixed in the past, maybe has regressed in the .net version and/or in the .net core 2.0 version?
[1]
$ find /c -iname "*Microsoft.Azure.Documents.ServiceInterop.dll*"
./Users/<myuser>/.nuget/packages/microsoft.azure.documentdb/1.19.1/runtimes/win7-x64/native/Microsoft.Azure.Documents.ServiceInterop.dll
./Users/<myuser>/.nuget/packages/microsoft.azure.documentdb/1.6.1/build/native/Microsoft.Azure.Documents.ServiceInterop.dll
./Users/<myuser>/.nuget/packages/microsoft.azure.documentdb.core/1.7.1/runtimes/win/native/Microsoft.Azure.Documents.ServiceInterop.dll
./Users/<myuser>/AppData/Local/Azure.Functions.Cli/1.0.7/Microsoft.Azure.Documents.ServiceInterop.dll
$ find /z -iname "*Microsoft.Azure.Documents.ServiceInterop.dll*"
./Git/documentdb-dotnet-todo-app/packages/Microsoft.Azure.DocumentDB.1.6.1/build/native/Microsoft.Azure.Documents.ServiceInterop.dll
./Git/documentdb-dotnet-todo-app/src/bin/Microsoft.Azure.Documents.ServiceInterop.dll
./Git/ReturnAdB2cGroups/CalorieCruncher/bin/Debug/netstandard2.0/bin/runtimes/win/native/Microsoft.Azure.Documents.ServiceInterop.dll
./Git/ReturnAdB2cGroups/CalorieCruncher/bin/Debug/netstandard2.0/bin/runtimes/win7-x64/native/Microsoft.Azure.Documents.ServiceInterop.dll
./Git/ReturnAdB2cGroups/CalorieCruncher/bin/Debug/netstandard2.0/Microsoft.Azure.Documents.ServiceInterop.dll
./Git/ReturnAdB2cGroups/packages/Microsoft.Azure.DocumentDB.1.6.1/build/native/Microsoft.Azure.Documents.ServiceInterop.dll
./Git/ReturnAdB2cGroups/ReturnAdB2cGroups/bin/Debug/netstandard2.0/bin/runtimes/win/native/Microsoft.Azure.Documents.ServiceInterop.dll
Yes, this is a strange issue I also observed. For some reason CLR complains about Microsoft.Azure.Documents.ServiceInterop.dll being missing even though it's actually one of it's dependencies DocumentDB.Spatial.Sql.dll is missing. Please make sure that both these native dlls are present.
Recently got this error inside a Azure Function using Microsoft.Azure.Documents.Core. It seems that that file is missing from that nuget package.
I created a test web app project 4.6. Installed the nuget Microsoft.Azure.Documents. Built the project and copy the DocumentDB.Spatial.Sql.dll file and the Microsoft.Azure.Documents.ServiceInterop.dll file into the bin folder of the function in Azure. You can get your Function's ftp information by downloading your publish profile in the Azure Portal and use a program like Filezilla to upload those files. My function ran fine after that.
User contributions licensed under CC BY-SA 3.0