QuickBooksDev
Member
- Joined
- Mar 2, 2008
- Messages
- 6
- Programming Experience
- 10+
We have just converted a large VB6 desktop app to VB.NET 2008. First via the VB 2005 (opened the project), then days of fixing errors, etc. Then opened the VB 2005 in VB 2008 so now it is a 2008 solution.
There are about 30 forms with code behind and about 40 other modules.
Message InvalidOperationException was unhandled.
... The type initializer for .... threw an error.
on
AppTest = true
App framework is enabled, it is using .net 3.5.
In a module there is
Public FormMain as frmMain = frmMain
Public AppTest as boolean = false
Public AppTest as boolean = false never gets executed but the FormMain does (as per a breakpoint).
AppTest = true in frmMain crashes with the indicated error.
This works in 6-7 other programs and has for years but crashes with indicated error
There are no errors when we do a build.
need just 1 with FormMain as a reference to frmMain.
This technique worked in many other programs but not this one. Not sure why.
In a working program that uses the same technique.
I hit F8 to step thru.
1. It goes into some CheckChanged events on frmMain so I assume the form is instantiated.
2. It then goes into the module with Public FormMain as frmMain = frmMain where it completes the definitions ok (does the last).
3. Then it goes to frmMain's MyBase.load
4. Program runs fine
In the failing program I hit F8
1. It immediately goes to the module with Public FormMain as frmMain = frmMain
(frmMain probably NOT instantiated)
2. The module definitions do not complete (last statement executed is the FormMain).
3. It goes to other modules for defintitions
4. It now goes to the ..Changed events on frmMain (on working programs this was first).
5. It then goes to the frmMain MyBase.load
So the failing program is taking a different startup path and I do not know why.
What would cause the modules to be executed first before frmMain is instantiated?????
Help!!!!
There are about 30 forms with code behind and about 40 other modules.
Message InvalidOperationException was unhandled.
... The type initializer for .... threw an error.
on
AppTest = true
App framework is enabled, it is using .net 3.5.
In a module there is
Public FormMain as frmMain = frmMain
Public AppTest as boolean = false
Public AppTest as boolean = false never gets executed but the FormMain does (as per a breakpoint).
AppTest = true in frmMain crashes with the indicated error.
This works in 6-7 other programs and has for years but crashes with indicated error
There are no errors when we do a build.
need just 1 with FormMain as a reference to frmMain.
This technique worked in many other programs but not this one. Not sure why.
In a working program that uses the same technique.
I hit F8 to step thru.
1. It goes into some CheckChanged events on frmMain so I assume the form is instantiated.
2. It then goes into the module with Public FormMain as frmMain = frmMain where it completes the definitions ok (does the last).
3. Then it goes to frmMain's MyBase.load
4. Program runs fine
In the failing program I hit F8
1. It immediately goes to the module with Public FormMain as frmMain = frmMain
(frmMain probably NOT instantiated)
2. The module definitions do not complete (last statement executed is the FormMain).
3. It goes to other modules for defintitions
4. It now goes to the ..Changed events on frmMain (on working programs this was first).
5. It then goes to the frmMain MyBase.load
So the failing program is taking a different startup path and I do not know why.
What would cause the modules to be executed first before frmMain is instantiated?????
Help!!!!