【发布时间】:2016-11-17 20:18:29
【问题描述】:
我知道这个问题已经回答了很多次,但我已经尝试了所有以前建议的解决方案。
1.) 目标 CPU 是 x86
2.) 我已经注册了 ocx 和 dll 文件
该应用程序在旧机器(所有操作系统)上运行良好,但在新图像上却不行。
这是日志:
框架版本:v4.0.30319 描述:进程被终止 由于未处理的异常。异常信息: System.Runtime.InteropServices.COMException 在 System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(System.Guid ByRef, System.Object, Int32, System.Guid ByRef) 在 System.Windows.Forms.AxHost.CreateWithLicense(System.String, System.Guid) 在 System.Windows.Forms.AxHost.CreateInstanceCore(System.Guid) 在 System.Windows.Forms.AxHost.CreateInstance() 在 System.Windows.Forms.AxHost.GetOcxCreate() 在 System.Windows.Forms.AxHost.TransitionUpTo(Int32) 在 System.Windows.Forms.AxHost.CreateHandle() 在 System.Windows.Forms.Control.CreateControl(Boolean) 在 System.Windows.Forms.Control.CreateControl(Boolean) 在 System.Windows.Forms.AxHost.EndInit() 在 Restaurant.frmMain.InitializeComponent() 在 Restaurant.frmMain..ctor()
异常信息:System.InvalidOperationException 在 Restaurant.My.MyProject+MyForms.Create__Instance__[System.__Canon, mscorlib,版本=4.0.0.0,文化=中性, PublicKeyToken=b77a5c561934e089] 在 Restaurant.frmMain.Main()
这是我注册文件的方式:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\Caspol -q -machine -addgroup 1 -url file://C:/xyz/* FullTrust -name "V Drive"
regsvr32 c:\xyz\crystl32.ocx
regsvr32 c:\xyz\MSCOMCT2.OCX
regsvr32 c:\xyz\MSDATGRD.OCX
regsvr32 c:\xyz\cpeaut32.dll
regsvr32 c:\xyz\msstdfmt.dll
Crystal 报告系统上安装了 .NET 4 框架的运行时引擎(x86 和 x64)。
【问题讨论】:
标签: vb.net com crystal-reports comexception