Visual Basic .NET » Visual Basic .NET General Discussion
Upgarded from vb6 to visual studio 2005 -- confused --


I used the wizard in VS 2005 to upgrade the vb6 app. I built the app,
then try to run it, but get this error
"System.TypeInitializationException was unhandled".

How do I handle this problem?

-- confused --



confused wrote:
I used the wizard in VS 2005 to upgrade the vb6 app. I built the app,
then try to run it, but get this error
"System.TypeInitializationException was unhandled".

How do I handle this problem?

I have checked the View Detail Exception anapshot: 

InnerException
{"That assembly does not allow partially trusted callers."}
Action System.Security.Permissions.SecurityAction.LinkDemand Demanded
'((System.Security.SecurityException)(((System.Exception)($exception)).InnerException)).Demanded'
threw an exception of type 'System.Security.SecurityException'

What exactly is it telling me to do?
I've tried Imports System.Security.SecurityException
'Imports System.Security.Permissions.SecurityPermission
'Imports System.Security.Permissions.SecurityAction

Not all at the same time and I'm still getting that System.TypeInitializationException was unhandled I have also clicked on the link get general help for the inner exception and associated tips has "Adjust the permission level of the assembly via the property page."
but that property page is not enabled.

-- confused --


I took the code off the network drive, placed on my c:\ drive declared the frmsplash and frmlogin as new frmsplash and frmlogin and here I do not get the "System.TypeInitializationException was unhandled" error nor the sub main killing the applicaiton. Just get errors because of the ado statements.

So, I copied the Module1 code into a new project created two blank forms (frmSplash and frmLogin) saved it on the network drive and everything ran for me without a problem. It looks as though in the long run I will end up rewriting this application.

[Submit Comment]Home