Thanks to all for the guidance to the deployment of WinForms. However, I am
still having an issue with getting the type of the form in my .NET dll.
When I run the code in Sub GetApp(), I get the following error, because the
gettype of the formAsm returns nothing. However if I set a reference to the
dll and run against that, the app comes up fine. Any ideas what I am doing
wrong?
Joe
---------------------------
AppLoader Error
---------------------------
System.ArgumentNullException: Value cannot be null. Parameter name: type
at System.Activator.CreateInstance(Type type, Boolean nonPublic) at
System.Activator.CreateInstance(Type type) at
AppLoader.frmAppLoad.GetApp() in C:\Documents and
Settings\Administrator.MARXBROS\My Documents\Visual Studio
Projects\AppLoader\Form1.vb:line 72
----------------------------------------
Sub GetApp()
Try
Dim sLocation As String
sLocation = "http://localhost/Apps/ProofOfConcept.dll"
Dim formAsm As Reflection.Assembly =
Reflection.Assembly.LoadFrom(sLocation)
Dim FormType As Type =
formAsm.GetType("ProofOfConcept.frmRunMe")
70
71 Dim formobj As Object
72 formobj = Activator.CreateInstance(FormType)
Dim form2 As Form = CType(formobj, Form)
form2.Show()
Catch exc As Exception
MsgBox(exc.ToString)
End Try
End Sub
You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.