CreateObject 导致应用程序池挂起
我正在运行此 VB.NET 代码将 WAV 文件转换为 mp3。它通常每小时运行约 20 次。应用程序池大约每天一次随机挂在 objMP3 = CreateObject("AudioConverter.AudioConverterx")
上。重新启动应用程序池即可解决该问题。
'convert the file
objMP3 = CreateObject("AudioConverter.AudioConverterx")
objMP3.Logfile = myLogFileName
objMP3.Convert(myWAVfile, myMP3file, "-cMP3")
objMP3 = Nothing
每次发生这种情况时,事件日志都会出现此错误:
故障应用程序 w3wp.exe,版本 6.0.3790.3959,标记 45d6968e, 错误模块audioconverter.dll,版本0.0.0.0,标记2a425e19, 调试? 0,故障地址0x0000402e。
并且系统日志有这样的内容:
为应用程序池“tts.servername.com”提供服务的进程超出了时间 关闭期间的限制。进程 ID 为“1340”。
我唯一能想到的是应用程序没有正确关闭。我读到 objMP3 = Nothing 实际上并没有关闭它(或者它的工作方式与经典 vb 中的工作方式不同)。
我还在服务器上设置了调试诊断。当发生挂起时,每秒会多次创建仅包含此行的大文件(> 8GB)。
[11/8/2011 9:28:36 PM] 第一次机会异常 - 0xc0000005 引起 系统 ID 为 2548 的线程
有什么想法吗?
I am running this VB.NET code to convert WAV files to mp3s. It typically runs about 20 times an hour. Randomly, about once a day, the app pool hangs on objMP3 = CreateObject("AudioConverter.AudioConverterx")
. Restarting the app pool fixes it.
'convert the file
objMP3 = CreateObject("AudioConverter.AudioConverterx")
objMP3.Logfile = myLogFileName
objMP3.Convert(myWAVfile, myMP3file, "-cMP3")
objMP3 = Nothing
Every time this happens, the Event Log has this error:
Faulting application w3wp.exe, version 6.0.3790.3959, stamp 45d6968e,
faulting module audioconverter.dll, version 0.0.0.0, stamp 2a425e19,
debug? 0, fault address 0x0000402e.
And the system log has this:
A process serving application pool 'tts.servername.com' exceeded time
limits during shut down. The process id was '1340'.
The only thing that I can think of is that the application isn't being closed properly. I've read that objMP3 = Nothing
doesn't actually close it (or it doesn't work the same as in classic vb).
I have also set up Debug Diagnostics on the server. When the hang occurs, a large file (> 8GB) is created with only this line multiple times a second.
[11/8/2011 9:28:36 PM] First chance exception - 0xc0000005 caused by
thread with System ID: 2548
Any Ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了从 .NET 正确释放 COM 对象,并确保其终结器运行,您应该调用 Marshall.ReleaseComObject。
这是我使用的代码:
In order to correctly release a COM object from .NET, and ensure it's finalizers are run, you should call Marshall.ReleaseComObject.
This is the code I use: