无法加载文件或程序集Bond.IO

使用Microsoft.Bing.Speech nuget包和Net Framework 4.6.1我在调用RecognizeAsync()时遇到此exception

无法加载文件或程序集“Bond.IO,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35”或其中一个依赖项。 定位的程序集的清单定义与程序集引用不匹配。 (HRESULTexception:0x80131040)

我的代码:

public static async Task SpeechToTextStreamPO(Stream audioStream, string textResult) { var subscriptionKey = ConfigurationManager.AppSettings["BingSpeechSubscriptionKey"]; Uri ShortPhraseUrl = new Uri(@"wss://speech.platform.bing.com/api/service/recognition"); Uri LongDictationUrl = new Uri(@"wss://speech.platform.bing.com/api/service/recognition/continuous"); CancellationTokenSource cts = new CancellationTokenSource(); var preferences = new Microsoft.Bing.Speech.Preferences("en-IN", ShortPhraseUrl, new CognitiveServicesAuthorizationProvider(subscriptionKey)); // Create aa speech client using (var speechClient = new SpeechClient(preferences)) { speechClient.SubscribeToRecognitionResult(async (recognitionResult) => { if (recognitionResult.RecognitionStatus == Microsoft.Bing.Speech.RecognitionStatus.Success) { textResult = recognitionResult.Phrases[0].DisplayText; } }); var deviceMetadata = new DeviceMetadata(DeviceType.Near, DeviceFamily.Mobile, NetworkType.CellLTE, OsName.Android, "1607", "Dell", "T3600"); var applicationMetadata = new ApplicationMetadata("SampleApp", "1.0.0"); var requestMetadata = new RequestMetadata(Guid.NewGuid(), deviceMetadata, applicationMetadata, "SampleAppService"); await speechClient.RecognizeAsync(new SpeechInput(audioStream, requestMetadata), cts.Token).ConfigureAwait(false);} } 

我尝试在.csproj中安装不同的版本并更改版本号,但我无法使其工作。

有任何想法吗?

将Bond.Core.CSharp包更改为4.2.0对我有用

Interesting Posts