P
Patrick Ravi-Pinto
Dear colleagues,
i'm new in the .net programming and hope you can help me.
I have two classes: Employee and Address
The Employee class has a reference to the Address and imports them on the
top.
I can test it locally, and it works but now I wants to load the Employee-DLL
with this code:
Public Function executeDllMethod(ByVal DllPath As String, ByVal ClassName As
String, ByVal DLLMethod As String) As Object
Dim myAssembly As Assembly
myAssembly = Assembly.LoadFrom(DllPath)
Dim myMethod As MethodInfo
Dim myType As Type
myType = myAssembly.GetType(ClassName)
'MsgBox(DLLMethod.ToString)
myMethod = myType.GetMethod(DLLMethod)
Dim o As New Object
o = Activator.CreateInstance(myType)
Dim result As Object
result = myMethod.Invoke(o, Nothing)
Return result
But it does not work. I receive only an error, that the Address-DLL cannot
be loaded (File not found)
When I register the Address-DLL in the GAC it works.
Do you know a solution without using the GAC or where's/what's the problem?
Thanks
Patrick
i'm new in the .net programming and hope you can help me.
I have two classes: Employee and Address
The Employee class has a reference to the Address and imports them on the
top.
I can test it locally, and it works but now I wants to load the Employee-DLL
with this code:
Public Function executeDllMethod(ByVal DllPath As String, ByVal ClassName As
String, ByVal DLLMethod As String) As Object
Dim myAssembly As Assembly
myAssembly = Assembly.LoadFrom(DllPath)
Dim myMethod As MethodInfo
Dim myType As Type
myType = myAssembly.GetType(ClassName)
'MsgBox(DLLMethod.ToString)
myMethod = myType.GetMethod(DLLMethod)
Dim o As New Object
o = Activator.CreateInstance(myType)
Dim result As Object
result = myMethod.Invoke(o, Nothing)
Return result
But it does not work. I receive only an error, that the Address-DLL cannot
be loaded (File not found)
When I register the Address-DLL in the GAC it works.
Do you know a solution without using the GAC or where's/what's the problem?
Thanks
Patrick