我一直试图让Speech-To-Text与Googles Speech Rocognizer合作。我一直在尝试的代码:
var credential = GoogleCredential
.FromStream(stream)
.CreateScoped(SpeechClient.DefaultScopes);
var channel = new Channel(
SpeechClient.DefaultEndpoint.Host,
credential.ToChannelCredentials());
return SpeechClient.Create(channel);
这会引发错误:System.TypeLoadException: Could not resolve type with token 0100003e (from typeref, class/assembly System.Runtime.Loader.AssemblyLoadContext, System.Runtime.Loader, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
如果我悬停credential.ToChannelCredentials()
,我会收到此警告:Assuming assembly reference 'Google.Apis.Auth, Version=1.21.0.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab' used by 'Grpc.Auth' matches identity 'Google.Apis.Auth, Version=1.34.0.0, Culture=neutral, PublicKeyToken='4b01fa6e34db77ab' of 'Google.Apis.Auth', you may need to supply runtime policy
我尝试更新nuget包并清理解决方案/重新启动Visual Studio。有人可以帮忙吗?
将Xamarin.Form用作共享项目,目前正在尝试使用Android虚拟设备。