UWP App CosmosDb Ошибка броска конструктора - PullRequest
0 голосов
/ 02 июня 2019

У меня есть ошибка, которую я не видел раньше.В моем конструкторе CosmosDb DocumentClient:

docClient = new DocumentClient(new 
  Uri("https://docdb.documents.azure.com:443/"),
    "key_here",new ConnectionPolicy { ConnectionMode = ConnectionMode.Direct, 
        ConnectionProtocol = Protocol.Tcp });

Когда я устанавливаю точку останова, она выдает эту ошибку:

 A type initializer threw an exception. To determine which type, 
 inspect the InnerException's StackTrace property.

Stacktrace InnerException:

Severity    Code    Description Project File    Line    Suppression State
Warning     MCG : warning MCG0007: Unresolved P/Invoke method 
'DocumentDB.LogStoreViewer.dll!FreeIOManager' 
for method 'System.Int32 


Microsoft.Azure.Documents.LogStoreViewerInterop.
LogStoreViewerInteropWrapper.
FreeIOManager(System.IntPtr)'.
Calling this method would throw exception at runtime. Please make sure the 
P/Invoke either points to a Windows API allowed in UWP applications, 
or a native DLL that is part of the package. If for some reason your 
P/Invoke does not satisfy those requirements, 
please use [DllImport(ExactSpelling=true) to indicate that you understand 
the implications of using non-UWP APIs.

В моем проектеЯ ссылаюсь на библиотеку классов .Net Standard 2.0.По информации об ошибке это выглядит как

 Microsoft.Azure.Documents.LogStoreViewerInterop.
 LogStoreViewerInteropWrapper.
 FreeIOManager(System.IntPtr)'.

Я не могу найти это, чтобы удалить его или понять, что он делает, поэтому не уверен, как вылечить эту злую вещь.

...