Load methods from dll dynamically in application
-
Hi I'm Creating a DLL File "Fr6Customise.dll" and Code is Imports System Namespace Fr6Customise Public Class LoadModule Public Shared Function ViewModule() As Boolean Return True End Function End Class End Namespace ---------------------------------------- Now I am using that dll in my project whenever needed... Dim CAssembly As Assembly = Assembly.LoadFrom(My.Application.Info.DirectoryPath & "\" & "FR6Customise.dll") Dim scriptType As Type = CAssembly.GetType("Fr6Customise. LoadModule") Dim mi As MethodInfo = scriptType.GetMethod("ViewModule") But, when I am using this Code scriptType always return Nothing. There is any error found in this Code. How Can I Solevd It. Pl, Help me.
Arindam Banerjee Sr. Software Developer Rance Computer Pvt Ltd. Kolkata (India)
-
Hi I'm Creating a DLL File "Fr6Customise.dll" and Code is Imports System Namespace Fr6Customise Public Class LoadModule Public Shared Function ViewModule() As Boolean Return True End Function End Class End Namespace ---------------------------------------- Now I am using that dll in my project whenever needed... Dim CAssembly As Assembly = Assembly.LoadFrom(My.Application.Info.DirectoryPath & "\" & "FR6Customise.dll") Dim scriptType As Type = CAssembly.GetType("Fr6Customise. LoadModule") Dim mi As MethodInfo = scriptType.GetMethod("ViewModule") But, when I am using this Code scriptType always return Nothing. There is any error found in this Code. How Can I Solevd It. Pl, Help me.
Arindam Banerjee Sr. Software Developer Rance Computer Pvt Ltd. Kolkata (India)
-
...
Dim scriptType As Type = CAssembly.GetType("Fr6Customise.Fr6Customise.LoadModule")
....That works for me, it's the fullname of the type
-
No, its Return "Nothing" Can You Just Email me Your Code.My Email ID : webarindam@gmail.com
Arindam Banerjee Sr. Software Developer Rance Computer Pvt Ltd. Kolkata (India)
Look in your application properties (of Fr6Customize) The value of your "Root namespace" is the root of the fullname of your Type. To see all types add the following line :
Dim types() as Type = CAssembly.GetTypes()
Set a breakpoint after this line and add a watch. BTW just nitpicking, your code
CAssembly.GetType("Fr6Customise. LoadModule")
has a space in the name. no luck mailing my code : "reason: 552-5.7.0 Our system detected an illegal attachment on your message." :omg:
modified on Tuesday, January 19, 2010 9:05 AM