简体   繁体   English

调用后ASP.NET应用程序挂起

[英]ASP.NET application hangs after a call

I'm having a simple ASP.NET application hosted on my local IIS6, under Vista. 我在Vista下的本地IIS6上托管了一个简单的ASP.NET应用程序。

It contains a button that when I click I execute a piece of code for recognizing the text in a WAV file (using the System.Speach.Recognition.SpeechRecognition class) and display the text in a label. 它包含一个按钮,当我单击时,我执行一段代码来识别WAV文件中的文本(使用System.Speach.Recognition.SpeechRecognition类),并在标签中显示文本。

The code works great on a desktop application, and it almost works on the web one... I say almost, because if I debug, I can see that the recognizer returns the correct text from the WAV, I can see that I am finishing the handler for the button click with no error, but nothing gets displayed in my page, and the page appears like loading... it's hanging, or something... No errors, no timeout, nothing. 该代码在桌面应用程序上运行良好,并且几乎可以在Web应用程序上运行...我几乎说,因为如果进行调试,我可以看到识别器从WAV返回正确的文本,可以看到我正在整理按钮的处理程序没有任何错误,但是我的页面中没有任何显示,并且该页面看起来像是正在加载...正在挂起,或其他...没有错误,没有超时,什么都没有。 Just loading... 刚刚加载中...

I don't know if this detail helps, but in order to make the piece of code that was already working on the desktop application work on the web application, I had to set the identity of the ApplicationPool of my application to LocalSystem (security breach, I know). 我不知道这个细节是否有帮助,但是为了使已经在桌面应用程序上运行的代码可以在Web应用程序上工作,我不得不将我的应用程序的ApplicationPool的标识设置为LocalSystem(违反安全性, 我知道)。 Otherwise, I would have received a Access Denied error (0x80070005(E_ACCESSDENIED)). 否则,我会收到“访问被拒绝”错误(0x80070005(E_ACCESSDENIED))。

Do you have any ideea why the call hangs like that? 您有什么想法为什么会这样挂断电话吗? I'm fighting with this for more than two days, time pressures me, and I have no clue... Any help is really welcomed! 我为此进行了超过两天的战斗,时间让我感到压力,而且我一无所知...真的欢迎任何帮助!

Thanks! 谢谢!

After another one week of stuglles, I found an overcome to the problem. 又过了一个星期的徒劳训练,我发现这个问题可以克服。 I'm posting this just so other that might have this problem find the solution faster. 我只是发布此消息,以便其他可能有此问题的人更快找到解决方案。

The solution was to call the method for making the speech recognition on a different thread. 解决方案是在另一线程上调用用于进行语音识别的方法。 I think this forced the release of all resources in that thread after the recognition ended. 我认为这迫使识别结束后释放该线程中的所有资源。

I cannot make any sense why this even happened on the first place (I used using blocks and I closed and disposed all the object in all the imagining ways), but I suspected to be a memory release problem... 我什至不知道为什么这首先发生(我使用块并以所有想象的方式关闭并放置了所有对象),但我怀疑是内存释放问题...

Anyway, a very simple call on another thread fix it! 无论如何,在另一个线程上进行非常简单的调用就可以解决它!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM