0

我正在尝试部署一个应用程序,该应用程序使用在 C# 中嵌入带有 AxHost 的 ActiveX 控件的库。

当我在我们的测试平台上运行已安装的应用程序时,我发现并显示以下异常:

Unexpected exception.

This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1)
   at System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid& clsid, Object punkOuter, Int32 context, Guid& iid)
   at System.Windows.Forms.AxHost.CreateWithoutLicense(Guid clsid)
   at System.Windows.Forms.AxHost.CreateWithLicense(String license, Guid clsid)
   at System.Windows.Forms.AxHost.CreateInstanceCore(Guid clsid)
   at System.Windows.Forms.AxHost.CreateInstance()
   at System.Windows.Forms.AxHost.GetOcxCreate()
   at System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)
   at System.Windows.Forms.AxHost.CreateHandle()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.AxHost.EndInit()
   at ....InitializeComponent()
   at ...

我用谷歌搜索了 0x800736B1,所以我知道这意味着无法加载文件。

现在的大问题是如何找出无法加载的文件

是否可以打开某种日志记录功能,或者是否有某种方法可以从异常中获取更多信息?

4

1 回答 1

0

除非它是您的 ActiveX 代码,否则这将很难或不可能。我建议使用像ProcessMonitor这样的工具来查找哪个文件句柄失败。如果你有代码,你可以在调试模式下运行它,或者改进它的日志记录。

当然你可以随时尝试

重新安装应用程序可能会解决此问题

于 2009-04-21T12:27:13.907 回答