首页 > 解决方案 > 在 program.exe 中发生了“System.IO.FileNotFoundException”类型的未处理异常

问题描述

VB.NET:program.exe 中发生了“System.IO.FileNotFoundException”类型的未处理异常

像这样的问题很少,但它们根本没有帮助。我在 VB.NET 中工作,我正在尝试将 COM 引用添加到项目中。几年前我成功地做到了,现在它不起作用。我已经成功注册了 dll,我已经尝试了我在这里阅读的所有内容,但是当我尝试运行程序时仍然出现错误。我已将平台从 AnyCPU 更改为 x86,工作目录设置为等于 bin\debug 目录,但它仍然无法正常工作。

Imports System.IO
Imports eVehicleRegistrationCOM

Public Class Form1

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

        Dim vd As New eVehicleRegistrationCOM.Registration

        Dim i As Integer
        i = vd.Initialize


    End Sub
End Class

问题出在这一行:

Dim vd As New eVehicleRegistrationCOM.Registration

这是整个错误

An unhandled exception of type 'System.IO.FileNotFoundException' occurred in program.exe

Additional information: Retrieving the COM class factory for component with CLSID {0BE1D001-F522-44E7-B956-F1E8A52179E0} failed due to the following error: 8007007e.

标签: .netvb.netbasicunhandled-exception

解决方案


推荐阅读