无法将方法组分配给隐式类型的局部变量 [英] Cannot assign method group to an implicitly-typed local variable

查看:23
本文介绍了无法将方法组分配给隐式类型的局部变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个错误

无法将方法组分配给隐式类型的局部变量"

"Cannot assign method group to an implicitly-typed local variable"

在这段代码中

private async void Button_Click_2(object sender, RoutedEventArgs e)
{
    var frenchvoice = InstalledVoices.All.Where(voice => voice.Language.Equals("fr-FR") & voice.Gender == VoiceGender.Female).FirstOrDefault; // in this line
    sp.SetVoice(frenchvoice);
    await sp.SpeakTextAsync(mytxt);
}

推荐答案

你忘记调用函数了(with ())

You forgot to call the function (with ())

这篇关于无法将方法组分配给隐式类型的局部变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆