2013-01-11 79 views
2

我有一個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) 

我的服務器上沒有任何聲音設備。這個例外是否正確?

+1

檢查應用程序日誌在事件查看器錯誤的詳細信息。 – jrummell

+0

以下是錯誤日誌**由於服務該應用程序池的進程中存在一系列故障,應用程序池「DomainName.com(domain)(4.0)(pool)」正被自動禁用。服務應用程序池「DomainName.com(域)(4.0)(pool)」的進程遭遇了Windows進程激活服務的致命通信錯誤。進程ID是'4948'。數據字段包含錯誤編號。** – Zahid

+0

在該條目之前應該有其他錯誤,告訴您實際問題是什麼。 IIS將關閉在特定時間段內失敗一定次數的應用程序池。您可以在應用程序池設置中進行配置。 – jrummell

回答

2

嘗試以下

  1. 是IIS運行
  2. 默認網站運行
  3. 應用程序池和ASP.Net版本
  4. 訪問是適當
+0

國際空間站和默認網站運行。 4版本的ASP.NET版本和應用程序池的.NET版本爲4.是訪問是適當的,因爲我可以輕鬆地訪問其他網站頁面。 – Zahid

+0

文本到語音是否正在嘗試訪問/寫入任何特定位置的內容/文件(線程無法訪問?) –

+0

下載ProcessExplorer並嘗試逐步分析 –

0

扎希德有正確的答案在這裏。 在IIS中,選擇應用程序池,單擊高級設置,然後選擇標識類型。

語音需要訪問用戶級別的數據。

0

嘗試授予C:\windows\system32\config\systemprofile\appdata\roaming對應用程序池所在的用戶的讀/寫訪問權限。

相關問題