2013-01-11 82 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对应用程序池所在的用户的读/写访问权限。

相关问题