gpt4 book ai didi

azure - 无法加载 DLL 'Microsoft.Azure.Documents.ServiceInterop.dll' [使用 Microsoft.Azure.DocumentDB 1.17.0]

转载 作者:行者123 更新时间:2023-12-05 08:41:51 24 4
gpt4 key购买 nike

我在我的项目中使用 Microsoft.Azure.DocumentDB 1.17.0 并收到以下错误。 “ServiceInterop.dll”Dll 存在于包含 Microsoft.Azure.DocumentDB dll 的文件夹中。但仍然低于错误

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)

最佳答案

我遇到了同样的问题(尽管使用 Microsoft.Azure.DocumentDB.Core (1.7.1)。

我通过安装解决了这个问题 https://www.nuget.org/packages/Microsoft.Azure.DocumentDB/ nuget 包。

PM> Install-Package Microsoft.Azure.DocumentDB -Version 1.19.1

现在在同一行我收到错误:消息:{“错误”:[“已使用针对非范围索引的路径的过滤器指定了无效查询。请考虑在请求中添加允许扫描 header 。”]}

所以,感觉本质上我的查询在某种程度上是有问题的,但是在我安装框架 nuget (并且只有核心 nuget)之前,该库没有对错误做出优雅的响应。

fwiw 我已经 grep 了我的/c(window 10 c 驱动器)和/z(安装有源代码的数据驱动器) - 请参阅此处了解这些 dll 现在所在的位置。

好的,现在修复实际的查询!

此外,fwiw:根据这个文档: https://learn.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.

这意味着这个问题在过去已经被修复,也许在 .net 版本和/或 .net core 2.0 版本中已经回归?

[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

关于azure - 无法加载 DLL 'Microsoft.Azure.Documents.ServiceInterop.dll' [使用 Microsoft.Azure.DocumentDB 1.17.0],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47087725/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com