You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Winforms听读程序启动异常及VS DiagnosticsHubPackage报错求助

WinForms听读程序在VS2022中打开报错,运行时axWindowsMediaPlayer初始化失败

大约一个月前用WinForms写了个简单的听读程序辅助工作,之前一直正常运行,最近突然出问题了。

打开项目时的错误提示

用Visual Studio 2022重新打开项目时,弹出如下错误:

The ‘DiagnosticsHubPackage’ package did not correctly.The problem may have been caused by a configuration change or by the installation of another extension. You can get more information by examining the file 'C:...\VisualStudio\17.0_e476ad3d\ActivityLog.xml'.

查了不少资料都没头绪,有人说要更新Windows或VS,但之前程序好好的,这个建议明显不合理。点提示框的「是」后能正常进入VS并打开项目,但运行项目时又出现新的异常。

运行时的异常信息

运行项目时,自动生成的代码里抛出System.ArgumentException:

System.ArgumentException: 'Source object does not expose 'IPropertyNotifySink' event interface.'

出错的代码片段:

this.tableLayoutPanel2.ResumeLayout(false);
this.tableLayoutPanel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.axWindowsMediaPlayer1)).EndInit(); // 错误行
this.ResumeLayout(false);

有没有遇到过相同问题的朋友?求一起探讨解决办法。

内容的提问来源于stack exchange,提问作者Yamp

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.25 06:02:07