PC Review


Reply
Thread Tools Rate Thread

Assembly.Loadfrom throws an Arguement Exception

 
 
Greg Behrendt
Guest
Posts: n/a
 
      15th Sep 2003
I am writing an application for a mobile device (Pocket Pc
2002) which has a small "Loader Application" which loads
an assembly from a virtual directory on a web server. This
way I can update the application and it is automatically
distributed to the mobile devices.

I am using VS2003, I create a download application using a
Smart Device project and set the project type to "class
library". This class just shows a form with a lable on it.
I build the project and copy the DLL to a virtual
directory on my web server. I create another application
to load the download app, again I use the Smart Device
Project but this time I set the project type to "Windows
Application". The loader app has a form with a button, in
the button_click event I have put your code:-

Dim a As [Assembly]
Dim sURL As String
= "http://192.168.4.152/downloads/DownloadApp.dll"

Try
a = [Assembly].LoadFrom(sURL)

Catch ex As System.ArgumentNullException
MsgBox(ex.Message)
Exit Sub
Catch ex As System.ArgumentOutOfRangeException
MsgBox(ex.Message)
Exit Sub
Catch ex As System.ArgumentException
MsgBox(ex.Message)
Exit Sub
Catch ex As Exception
MsgBox(ex.Message)
Exit Sub
End Try



Dim appForm As Form = a.CreateInstance
("DownloadApp.Form1")

appForm.Show()


When I launch the loader app in the emulator and the code
hits the loadfrom method I get the Arguement Exception.
If I launch IE on the emulator I can browse the virtual
directory where the dll is so the emulator can see the web
server.

This same code works great as a standard windows
application but not as a mobile application. Havs anyone
tried this with the Compact Framework?

Any help you can offer would be appreciated.

Greg Behrendt
 
Reply With Quote
 
 
 
 
Alex Feinman [MVP]
Guest
Posts: n/a
 
      16th Sep 2003
What you are trying to do will require CIFS that does not exist on CE
platform. The fact that IE can browse your vistual directory has nothing to
do with being or not being able to open web documents through filesystem
calls.

You need to download the assembly to the local directory using
HttpWebRequest class and then use local filesystem-based path

"Greg Behrendt" <(E-Mail Removed)> wrote in message
news:072d01c37bdc$999a8c90$(E-Mail Removed)...
> I am writing an application for a mobile device (Pocket Pc
> 2002) which has a small "Loader Application" which loads
> an assembly from a virtual directory on a web server. This
> way I can update the application and it is automatically
> distributed to the mobile devices.
>
> I am using VS2003, I create a download application using a
> Smart Device project and set the project type to "class
> library". This class just shows a form with a lable on it.
> I build the project and copy the DLL to a virtual
> directory on my web server. I create another application
> to load the download app, again I use the Smart Device
> Project but this time I set the project type to "Windows
> Application". The loader app has a form with a button, in
> the button_click event I have put your code:-
>
> Dim a As [Assembly]
> Dim sURL As String
> = "http://192.168.4.152/downloads/DownloadApp.dll"
>
> Try
> a = [Assembly].LoadFrom(sURL)
>
> Catch ex As System.ArgumentNullException
> MsgBox(ex.Message)
> Exit Sub
> Catch ex As System.ArgumentOutOfRangeException
> MsgBox(ex.Message)
> Exit Sub
> Catch ex As System.ArgumentException
> MsgBox(ex.Message)
> Exit Sub
> Catch ex As Exception
> MsgBox(ex.Message)
> Exit Sub
> End Try
>
>
>
> Dim appForm As Form = a.CreateInstance
> ("DownloadApp.Form1")
>
> appForm.Show()
>
>
> When I launch the loader app in the emulator and the code
> hits the loadfrom method I get the Arguement Exception.
> If I launch IE on the emulator I can browse the virtual
> directory where the dll is so the emulator can see the web
> server.
>
> This same code works great as a standard windows
> application but not as a mobile application. Havs anyone
> tried this with the Compact Framework?
>
> Any help you can offer would be appreciated.
>
> Greg Behrendt



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Assembly.LoadFrom(...) throw exception _HResult = -2146232800 gc Microsoft Dot NET Compact Framework 7 26th Jul 2007 05:08 PM
Assembly.LoadFrom(...) throws exception _HResult = -2146232800 charalampos Microsoft Dot NET Compact Framework 2 19th Jul 2007 08:26 AM
Assembly.LoadFrom(...) throws exception _HResult = -2146232800 gc Microsoft Dot NET Compact Framework 0 18th Jul 2007 07:44 AM
Assembly.LoadFrom throws PathTooLongException unexpectedly. shrishjain@gmail.com Microsoft C# .NET 6 21st Feb 2006 06:05 PM
Assembly.LoadFrom throws a System.IO.FileNotFoundException when used within a web service surya Microsoft C# .NET 0 19th Jan 2004 10:57 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:13 PM.