当我到达 new DocumentClient(new Uri("https://192.168.30.104:10251"), _key)
行时,我得到一个 bcrypt.dll not found
.
我正在使用 VS for Mac,最新版本和 DocumentDb.Core nugget 包版本 1.3.2(最新版本)...
我试了一下并降级到版本 1.0.0 但我遇到了同样的错误...
堆栈跟踪是:
at Microsoft.Azure.Documents.SecureStringHMACSHA256Helper.NativeMethods.BCryptOpenAlgorithmProvider(IntPtr& algorithmHandle, String algorithmId, IntPtr implementation, UInt32 flags)
at Microsoft.Azure.Documents.SecureStringHMACSHA256Helper..ctor(SecureString base64EncodedKey)
at Microsoft.Azure.Documents.Client.DocumentClient..ctor(Uri serviceEndpoint, SecureString authKey, ConnectionPolicy connectionPolicy, Nullable`1 desiredConsistencyLevel)
编辑1
我把代码邮寄给 friend ,他在常规VS 2017上运行没有错误
最佳答案
DocumentClient
类有多个构造函数。您正在使用one that takes a SecureString
作为第二个参数。如果您使用 constructor that takes a plain string
那么你的代码应该可以工作。
我确实同意这可能是一个错误。
关于visual-studio - VS for MAC 和 DocumentDb.Core - BCrypt.DLL 丢失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45327992/