Dies ist die Ausgabe:
Code: Select all
Exception thrown: 'System.IO.FileNotFoundException' in Azure.AI.FormRecognizer.dll
An exception of type 'System.IO.FileNotFoundException' occurred in Azure.AI.FormRecognizer.dll but was not handled in user code
Could not load file or assembly 'System.Diagnostics.DiagnosticSource, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
Code: Select all
So sieht der Fehler aus wie zur Laufzeit:
Code: Select all
private Uri _uri;
private AzureKeyCredential _credential;
private DocumentAnalysisClient _analysisClient;
private DocumentModelAdministrationClient _modelClient;
public AzureOcr()
{
_uri = new Uri(_diEndpoint);
_credential = new AzureKeyCredential(_diKey);
_analysisClient = new DocumentAnalysisClient(_uri, _credential); // here it throws "System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Diagnostics.DiagnosticSource, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.'"
_modelClient = new DocumentModelAdministrationClient(_uri, _credential);
}