运行访问网络摄像头的 C# 应用程序时遇到此错误消息

发布于 2024-12-27 16:55:34 字数 4163 浏览 2 评论 0原文

我有一个应用程序在几台机器上运行良好,但在一台关键演示单元上运行不佳。这是一个简单的 winform 应用程序,用于访问网络摄像头并尝试录制视频。该应用程序启动后立即崩溃。这是异常消息:

***异常文本 ******* System.Runtime.InteropServices.COMException(0x80040154):类不是 已注册(HRESULT 异常:0x80040154 (REGDB_E_CLASSNOTREG)) 在 System.Runtime.InteropServices.Marshal.BindMoniker(IMoniker pmk, UInt32 grfOpt,Guid& iidResult、对象& ppv结果)在 System.Runtime.InteropServices.Marshal.BindToMoniker(字符串 monikerName) 在 DirectX.Capture.Capture.createGraph() 中 C:\Users\SONY\Downloads\Compressed\DirectXCapture_demo_Enhanced\DirectXCapture_demo\DirectX.Capture\Capture.cs:line 分段阅读_第 1107 章 音频设备)中 C:\Users\SONY\Downloads\Compressed\DirectXCapture_demo_Enhanced\DirectXCapture_demo\DirectX.Capture\Capture.cs:line 第928章 事件参数 e) 中 E:\Project_extra\LiLi_project\Ivypromise_desktopApp\Ivypromise\Ivypromise\webcame\WebCame.cs:line 209 在 System.Windows.Forms.Control.OnClick(EventArgs e) 处 System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message&m, MouseButtons 按钮,Int32 单击)位于 System.Windows.Forms.Control.WndProc(Message&m) at System.Windows.Forms.ButtonBase.WndProc(Message&m) at System.Windows.Forms.Button.WndProc(Message&m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&m) 在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) 在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg、IntPtr wparam、IntPtr lparam)

***** 加载的程序集 ******* mscorlib 汇编版本:2.0.0.0 Win32 版本:2.0.50727.4963 (win7RTMGDR.050727-4900) 代码库: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll ---------------------------------------------------- 常春藤承诺 汇编版本:1.0.0.0 Win32版本:1.0.0.0 代码库: file:///C:/Users/Jenny/Dropbox/To%20share/li/Release/Ivypromise.exe ---------------------------------------------------- 系统.Windows.窗体 汇编版本:2.0.0.0 Win32 版本:2.0.50727.4961 (win7RTMGDR.050727-4900) 代码库: file:///C:/Windows/ assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll - - - - - - - - - - - - - - - - - - - - 系统 汇编版本:2.0.0.0 Win32 版本:2.0.50727.4962 (win7RTMGDR.050727-4900) 代码库: file:///C:/Windows/ assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll ---------------------------------------------------- 系统图 汇编版本:2.0.0.0 Win32 版本:2.0.50727.4927 (NetFXspW7.050727-4900) 代码库: file:///C:/Windows/ assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll ---------------------------------------------------- DirectX.Capture 程序集版本:1.0.4380.42651 Win32版本:1.0.4380.42651 代码库: file:///C:/Users/Jenny/Dropbox/To%20share/li/Release/DirectX.Capture.DLL ---------------------------------------------------- DShowNET 汇编版本:1.0.0.1 Win32版本:1.0.0.1 代码库: file:///C:/Users/Jenny/Dropbox/To%20share/li/Release/DShowNET.DLL ---------------------------------------------------- 系统.Xml 汇编版本:2.0.0.0 Win32 版本:2.0.50727.4927 (NetFXspW7.050727-4900) 代码库: file:///C:/Windows/ assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll ---------------------------------------------------- Microsoft.DirectX.AudioVideoPlayback 程序集版本:1.0.2902.0 Win32版本:5.04.00.2904

代码库:file:///C:/Users/Jenny/Dropbox/To%20share/li/Release/Microsoft.DirectX.AudioVideoPlayback.DLL

***** JIT 调试 ******* 要启用即时 (JIT) 调试,此应用程序的 .config 文件或电脑 (machine.config) 中必须设置 jitDebugging 值 system.windows.forms 部分。该应用程序还必须编译 启用调试。

例如:

当启用 JIT 调试时,任何未处理的异常都将被发送到 JIT 调试器注册在计算机上而不是由 这个对话框。

I have an application that's running fine on a few machines but not on one critical demo unit. It's simple winform application that accesses webcam and attempts to record a video. This application immediately crashes when started. Here's the Exception message:

*** Exception Text ******* System.Runtime.InteropServices.COMException (0x80040154): Class not
registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
at System.Runtime.InteropServices.Marshal.BindMoniker(IMoniker pmk,
UInt32 grfOpt, Guid& iidResult, Object& ppvResult) at
System.Runtime.InteropServices.Marshal.BindToMoniker(String
monikerName) at DirectX.Capture.Capture.createGraph() in
C:\Users\SONY\Downloads\Compressed\DirectXCapture_demo_Enhanced\DirectXCapture_demo\DirectX.Capture\Capture.cs:line
1107 at DirectX.Capture.Capture..ctor(Filter videoDevice, Filter
audioDevice) in
C:\Users\SONY\Downloads\Compressed\DirectXCapture_demo_Enhanced\DirectXCapture_demo\DirectX.Capture\Capture.cs:line
928 at Ivypromise.webcame.WebCame.buttonRecord_Click(Object sender,
EventArgs e) in
E:\Project_extra\LiLi_project\Ivypromise_desktopApp\Ivypromise\Ivypromise\webcame\WebCame.cs:line
209 at System.Windows.Forms.Control.OnClick(EventArgs e) at
System.Windows.Forms.Button.OnClick(EventArgs e) at
System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at
System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks) at
System.Windows.Forms.Control.WndProc(Message& m) at
System.Windows.Forms.ButtonBase.WndProc(Message& m) at
System.Windows.Forms.Button.WndProc(Message& m) at
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&
m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)

***** Loaded Assemblies ******* mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4963 (win7RTMGDR.050727-4900)
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
---------------------------------------- Ivypromise
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Users/Jenny/Dropbox/To%20share/li/Release/Ivypromise.exe
---------------------------------------- System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4961 (win7RTMGDR.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
---------------------------------------- System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4962 (win7RTMGDR.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
---------------------------------------- System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
---------------------------------------- DirectX.Capture
Assembly Version: 1.0.4380.42651
Win32 Version: 1.0.4380.42651
CodeBase: file:///C:/Users/Jenny/Dropbox/To%20share/li/Release/DirectX.Capture.DLL
---------------------------------------- DShowNET
Assembly Version: 1.0.0.1
Win32 Version: 1.0.0.1
CodeBase: file:///C:/Users/Jenny/Dropbox/To%20share/li/Release/DShowNET.DLL
---------------------------------------- System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
---------------------------------------- Microsoft.DirectX.AudioVideoPlayback
Assembly Version: 1.0.2902.0
Win32 Version: 5.04.00.2904

CodeBase: file:///C:/Users/Jenny/Dropbox/To%20share/li/Release/Microsoft.DirectX.AudioVideoPlayback.DLL

***** JIT Debugging ******* To enable just-in-time (JIT) debugging, the .config file for this application or computer
(machine.config) must have the jitDebugging value set in the
system.windows.forms section. The application must also be compiled
with debugging enabled.

For example:

When JIT debugging is enabled, any unhandled exception will be sent to
the JIT debugger registered on the computer rather than be handled by
this dialog box.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

挽心 2025-01-03 16:55:34

我们切换到 directShow.net dll,它可以在我们所有的机器上运行。我们认为我们原来的解决方案中缺少一些网络摄像头驱动程序接口。

We switched to directShow.net dll and it worked on all our machines. We think we were missing some webcam driver interface in our original solution.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文