I an trying to use the speech SDK in blazor webasm app, but with recurring problem of missing "Microsoft.CognitiveServices.Speech.core.dll".
There are a few reports about this issue, but not single one relating to webasm app.
Steps to reproduce the problem:
Install Speech SDK packagesc3
Update Index.Razor with minimum code to reproduce
@page "/"@using Microsoft.CognitiveServices.Speech;<h1>Bug Reproduction</h1>@code { private static readonly string SpeechSubscriptionKey = "somevalidkey"; private static readonly string SpeechLocation = "somelocation"; private SpeechConfig _SpeechConfig; protected override async Task OnInitializedAsync() { _SpeechConfig = SpeechConfig.FromSubscription(SpeechSubscriptionKey, SpeechLocation); }}- Now, when build and run (no matter debug/release, clean/rebuild, publish etc.) will get you the console output:
crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100] Unhandled exception rendering component: Microsoft.CognitiveServices.Speech.core.dllSystem.DllNotFoundException: Microsoft.CognitiveServices.Speech.core.dll at Microsoft.CognitiveServices.Speech.SpeechConfig.FromSubscription(String subscriptionKey, String region) The app page in the chrome opens, but the resource is indeed missing:sc5
As I mentioned, I found several reports about bugs related to this issue, but none of webasm target.The only resolution I found mentioned was to manually copy the Microsoft.CognitiveServices.Speech.core.dll to the target directory.
I am not quite sure how to do that correctly for webasm project, as I am new to it (as well as to .net as a whole).
As an act of desperate man, I tried copying Microsoft.CognitiveServices.Speech.core.dll to the folder \bin\Debug\net5.0\wwwroot_framework\ and updating blazor.boot.json. The dll will then appear in blazor-resources in chrome, but the error message is the same. (System.DllNotFoundException).
The problem is that I have no idea which of the Microsoft.CognitiveServices.Speech.core.dll files I can find in nuget\packages\microsoft.cognitiveservices.speech\1.14.0\ folder could work, if any.
I may be missing something important here, any help or explanation what goes on would be greatly appreciated.