我有一個ASP.NET應用程序,它可以處理文本到語音TTS。該代碼在本地機器上正常工作,但是當我將其部署在Windows 2008 R2服務器Enterprise 64位上時,應用程序池只會崩潰。該應用程序由v4.0 .NET框架構成。我在服務器上使用IIS 7。以下是應用程序池崩潰時的錯誤。ASP.NET文本到語音代碼在本地開發機器上工作,但不在生產服務器上
Service Unavailable
HTTP Error 503. The service is unavailable.
這是我應該添加哪些代碼ealier
MemoryStream ms = new MemoryStream();
context.Response.ContentType = "audio/wav";
Thread t = new Thread(() =>
{
SpeechSynthesizer ss = new SpeechSynthesizer();
ss.SetOutputToWaveStream(ms);
ss.Speak(context.Request.QueryString["tts"]);
});
t.Start();
t.Join();
ms.Position = 0;
ms.WriteTo(context.Response.OutputStream);
context.Response.End();
任何幫助將不勝感激
感謝
這裏是異常
An unhandled exception occurred and the process was terminated.
Application ID: /LM/W3SVC/17/ROOT
Process ID: 5340
Exception: System.UnauthorizedAccessException
Message: Retrieving the COM class factory for component with CLSID {A832755E-9C2A-40B4-89B2-3A92EE705852} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
StackTrace: at System.Speech.Internal.Synthesis.VoiceSynthesis.Speak(Prompt prompt)
at System.Speech.Synthesis.SpeechSynthesizer.Speak(Prompt prompt)
at TTS.<>c__DisplayClass3.<ProcessRequest>b__0()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
的更多細節。我已將IIS_USRS的完整權限授予C:\ Program Files(x86)\ Microsoft Speech SDK 5.1 \ Bin \ TTSEng.dll文件。現在錯誤更改爲
An unhandled exception occurred and the process was terminated.
Application ID: /LM/W3SVC/17/ROOT
Process ID: 2816
Exception: System.InvalidOperationException
Message: No voice installed on the system or none available with the current security setting.
StackTrace: at System.Speech.Internal.Synthesis.VoiceSynthesis.Speak(Prompt prompt)
at System.Speech.Synthesis.SpeechSynthesizer.Speak(Prompt prompt)
at TTS.<>c__DisplayClass3.<ProcessRequest>b__0()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
我的服務器上沒有任何聲音設備。這個例外是否正確?
檢查應用程序日誌在事件查看器錯誤的詳細信息。 – jrummell
以下是錯誤日誌**由於服務該應用程序池的進程中存在一系列故障,應用程序池「DomainName.com(domain)(4.0)(pool)」正被自動禁用。服務應用程序池「DomainName.com(域)(4.0)(pool)」的進程遭遇了Windows進程激活服務的致命通信錯誤。進程ID是'4948'。數據字段包含錯誤編號。** – Zahid
在該條目之前應該有其他錯誤,告訴您實際問題是什麼。 IIS將關閉在特定時間段內失敗一定次數的應用程序池。您可以在應用程序池設置中進行配置。 – jrummell