If sLocation is a string, shouldn't the path be in quotes?
Ken
"cksj" <cksanjose@dotnet.itags.org.hotmail.com> wrote in message
news:%230CsyH9TDHA.1912@dotnet.itags.org.tk2msftngp13.phx.gbl...
I'm working on first app in Smart Client programming.
I have a very simple application that has 3 textboxes and 1 command button.
The command button will add the numbers in the first 2 textboxes and puts
the sum in the 3rd textbox. The app is done in VB.Net and is compiled as a
dll. I have another exe app that will load the dll from the http server.
When I ran the exe on my machine where the dll is located I get an error.
The error I get is file not found or dependency file not found.
Here's my code:
Try
'Download the assembly from a web server over HTTP
Dim sLocation As String
sLocation = HTTP://MIS0014/AdditionServer/AdditionServer.dll
Dim formAsm As [Assembly] = [Assembly].LoadFrom(sLocation)
'Get the Form from the assembly
Dim formtype As Type = formAsm.GetType("AdditionServer.AddNumbers")
'Create an instance of the Form
Dim FormObj As Object
FormObj = Activator.CreateInstance(formtype)
'Cast it to a Form object to enable early binding and show the form
Dim Form1 As Form = CType(FormObj, Form)
Form1.Show()
Catch exc As Exception
MsgBox(exc.ToString)
End TryOn my original code, the location is between quotes. When I pasted the code,
some how the quotes were gone.
When I run my program, I also get a DCOM error. The error states that the
IWAM account can't logon to the computer. I looked at my Local Policy and
under "logon locally" rights, the IWAM account is in there. Did I miss any
other security?
"Ken Cox [Microsoft MVP]" <BANSPAMken_cox@.sympatico.ca> wrote in message
news:OpjETc%23TDHA.1724@.TK2MSFTNGP10.phx.gbl...
> If sLocation is a string, shouldn't the path be in quotes?
> Ken
> "cksj" <cksanjose@.hotmail.com> wrote in message
> news:%230CsyH9TDHA.1912@.tk2msftngp13.phx.gbl...
> I'm working on first app in Smart Client programming.
> I have a very simple application that has 3 textboxes and 1 command
button.
> The command button will add the numbers in the first 2 textboxes and puts
> the sum in the 3rd textbox. The app is done in VB.Net and is compiled as a
> dll. I have another exe app that will load the dll from the http server.
> When I ran the exe on my machine where the dll is located I get an error.
> The error I get is file not found or dependency file not found.
> Here's my code:
> Try
> 'Download the assembly from a web server over HTTP
> Dim sLocation As String
> sLocation = HTTP://MIS0014/AdditionServer/AdditionServer.dll
> Dim formAsm As [Assembly] = [Assembly].LoadFrom(sLocation)
> 'Get the Form from the assembly
> Dim formtype As Type = formAsm.GetType("AdditionServer.AddNumbers")
> 'Create an instance of the Form
> Dim FormObj As Object
> FormObj = Activator.CreateInstance(formtype)
> 'Cast it to a Form object to enable early binding and show the form
> Dim Form1 As Form = CType(FormObj, Form)
> Form1.Show()
> Catch exc As Exception
> MsgBox(exc.ToString)
> End Try
>
>
0 comments:
Post a Comment