Could not Load type from Assembly ... because the format is invalid

G

Guest

H

I am trying to create object in the current app domain using CreateInstanceAndUnwrap. It is throwing the exception. Any ide

---------------------------------------------------------------------------------------------------------------------------------------------
ERROR MESSAG
---------------------------------------------------------------------------------------------------------------------------------------------
Could not load type net..events.KofaxDocAddProcess from assembly ProbationEvents, Version=1.0.1613.25241, Culture=neutral, PublicKeyToken=null because the format is invalid

Source: mscorli

StackTrace: at System.Reflection.Assembly.GetTypeInternal(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean publicOnly
at System.Activator.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo, StackCrawlMark& stackMark
at System.Activator.CreateInstance(String assemblyName, String typeName
at System.AppDomain.CreateInstance(String assemblyName, String typeName
at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName

---------------------------------------------------------------------------------------------------------------------------------------------
CODE IS GIVE BELO
---------------------------------------------------------------------------------------------------------------------------------------------- Dim obj As Objec

Tr

obj = System.AppDomain.CurrentDomain.CreateInstanceAndUnwrap(TxtAssembly.Text, TxtClass.Text
If (obj Is Nothing) The
lblInfo.Text = "Object is nothing
Els
lblInfo.Text = "Object created successfuly
End I
Catch ex As Exceptio
lblInfo.Text = ex.Source & "<=========>" & ex.Message & "<=========>" & ex.StackTrac
If (Not (ex.InnerException Is Nothing)) The
lblInfo.Text = lblInfo.Text & " ********* " & ex.InnerException.Message & "<=========>" & ex.InnerException.StackTrac
End I

End Try
 
G

Guest

---------------------------------------------------------------------------------------------------------------------------------------------
ERROR MESSAG
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top