2.0 .Net Framework error: EventType clr20r3 system.invalidoperationexception error

I get this error while attempting to run a visual basic.net program on a customer's pc.

This is the list of references I'm using:
Imports System
Imports System.Data
Imports System.Data.OleDb
Imports System.IO
Imports System.Text
Imports JBInterface
Imports System.Xml
Imports System.Convert
Imports System.String

I've researched this error and it seems this is either a .Net Framework issue or a missing or unregistered dll.  I beleive this error is happening before my form load even attempt to run.

I found the below subroutine while researching this error so I've added this but would like further thoughts on how to isolate what the cause is as this error seems generic and has many causes.

Private Sub WorkerThreadHandler(ByVal sender As Object, ByVal args As UnhandledExceptionEventArgs)

If Not TypeOf args.ExceptionObject Is Threading.ThreadAbortException Then
Dim exc As Exception = args.ExceptionObject
MessageBox.Show(exc.ToString())
End If

End Sub


Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

AddHandler AppDomain.CurrentDomain.UnhandledException, AddressOf Me.WorkerThreadHandler

Your assistance would be much appreciated.
JMO9966Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Den_HBRCommented:
Does the program work on other computers?

Is this pc by any chance a 64-bit?
If so, try setting "Target CPU" to x86 in "advanced compile options" on the "compile"-tab of your project properties.

Maybe you could try to uninstall and reïnstall the framework?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JMO9966Author Commented:
Yes, It works on most other machines, but I've ran into this issue a few times.

One item on my list is to repair and/or reinstall 2.0 Framework, thanks.

Is there a way to get more details from this error?  If it's happening prior to form load, is there a way to trap this error??

thanks
Den_HBRCommented:
Create a new module and put below code in it.

Then disable "enable application framework" on the "application"-tab of your project properties.
Then select "Sub Main" as your startup object.


Public Sub Main()
        Try
            Dim _frmMain As New frmMain
            _frmMain.ShowDialog()
        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try
    End Sub

Open in new window

CodeCruiserCommented:
If its happening prior to form load, its probably due to a third party component that you are using.

What is JBInterface? Is it COM? Is it registered on the computer?
JMO9966Author Commented:
Yes, JBInterface is a com object.

I will make sure to register this.

Thanks
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.