Closed lokeshkumarn closed 6 years ago
Even in Web API 2 , I am facing the issue [BadImageFormatException: Could not load file or assembly 'SpeechClient' or one of its dependencies. An attempt was made to load a program with an incorrect format.] System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0 System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +36 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +152 System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +77 System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +21 System.Reflection.Assembly.Load(String assemblyString) +28 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +38
For using with Web API, could you please try C# Service Library? It should work with Web API, but probably not with WebCore. We are currently working on a new version which supports WebCore.
Service library not responding wss://xxxxxxxxxxxxxxxxxxxxxxxx.api.cris.ai/speech/recognition/interactive/cognitiveservices/v1 Continously calling the GetAuthorizationTokenAsync -- > FetchToken method in the IAuthorizationProvider
it seems that the URL you were using points to Custom Speech Service (cris.ai). Which service are you using for speech recognition?
Using CRIS.ai for Speech To Text
I am getting this error Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.
Custom Speech Service (cris.ai) is a different service than Bing Speech Service. If you have problem when using cris.ai, please contact the Custom Speech Service team.
@lokeshkumarn I talked to the CRIS team, and you probably need to change the URL for token service, as described here: "When using the Service librady you have to change the URI of the authorization provider in the implementation of IAuthorizationProvider to https://westus.api.cognitive.microsoft.com/sts/v1.0/issueToken."
yes it worked after changing the URI
Thanks
Great to know it works now. I am closing the issue. Please feel free to open a new one if you have issues.
Would I be able to use the SpeechClient.dll in web api core
Why I am asking this is because I am getting EntryPointNotFoundException with C++ module failed to load in web api if I use it.