首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法加载文件或程序集Bond.IO

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

Stack Overflow用户
提问于 2018-06-11 17:19:58
回答 1查看 1.3K关注 0票数 3

使用Microsoft.Bing.Speech nuget包和.NET Framework4.6.1调用RecognizeAsync()时会出现此异常

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

我的代码:

代码语言:javascript
复制
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);}
    }

我尝试过在.csproj中安装不同的版本和更改版本号,但是我无法让它工作。

有什么想法吗?

EN

回答 1

Stack Overflow用户

发布于 2018-06-25 01:40:36

它适用于我将Bond.Core.CSharp包更改为4.2.0

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50803039

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档