Could not load file or assembly Bond.IO

3

Using Microsoft.Bing.Speech nuget package and Net Framework 4.6.1 I'm having this exception when calling RecognizeAsync()

Could not load file or assembly 'Bond.IO, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

My code:

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 a a 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);}
    }

I've tried installing different versions and changing version numbers in .csproj but I can't make it work.

Any ideas?

c#
botframework
microsoft-cognitive
azure-cognitive-services
asked on Stack Overflow Jun 11, 2018 by Imartin • edited Jun 11, 2018 by Imartin

1 Answer

1

it worked for me with changing Bond.Core.CSharp package to 4.2.0

answered on Stack Overflow Jun 25, 2018 by Ram chittala

User contributions licensed under CC BY-SA 3.0