广告:
未处理 System.InvalidOperationException
Message=系统上未安装语音,或没有当前安全设置可用的语音。
Source=Mvccom
StackTrace:
在 Mvccom.SpeakThread.SpeakChina() 位置 E:\asp.net2.0\mvc_elec-gs\Mvccom\SpeakThread.cs:行号 49
在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
在 System.Threading.ExecutionContext.runTryCode(Object userData)
在 System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode
backoutCode, Object userData)
在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object
state)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading.ThreadHelper.ThreadStart()
InnerException:
System.ArgumentException: 不能设置语音。未安装匹配的语音,或语音被禁用。 在
System.Speech.Synthesis.SpeechSynthesizer.SelectVoice(String name) 在 Mvccom.Speak.SpeakChina(String bodystr) 位置 E:
\asp.net2.0\mvc_elec-gs\Mvccom\Speak.cs:行号 59
语音:Microsoft Anna,Microsoft Lili,
System.ArgumentException: 不能设置语音。未安装匹配的语音,或语音被禁用。
在 System.Speech.Synthesis.SpeechSynthesizer.SelectVoice(String name)
在 Mvccom.Speak.SpeakChina(String bodystr) 位置 E:\asp.net2.0\mvc_elec-gs\Mvccom\Speak.cs:行号 66<br>
系统语音:Microsoft Anna,Microsoft Lili,Microsoft Mary,Microsoft Mike,Microsoft Simplified Chinese,SampleTTSVoice,
Select "TexttoSpeechTTS", then in the Properties tab, "Configuration" -> "Set initial configuration", set "Voice which will
say text" to "Microsoft Anna", and "Voice volume" to "50". Then it's OK.
This may come from using "Microsoft Anna - English (United States)" but not "Microsoft Anna" when init auto in Windows other
than English edition.
No voice installed on the system or none available with the current security setting
speech iis
通过dcomcnfg.exe配置ASPNET用户的权限应该也可以解决这个问题。
1. 权限问题;你可以尝试把应用程序池的进程标识改成LocalSystem
2. webconfig配置: system.web 下面 <identity impersonate="true" userName="YourAdminUsr" password="YourAdminPwd"/>
广告: