Loading Class Library From FTP Location To Memory

C

Coder

After deploying main application using Clickonce,

Is this possible for this dot net application to download a class library
from an ftp or http location (as only one dll) and to use it just in memory
(I dont like to save it somewhere, just load into memory and use it) ? Next
time someome want s to use that class library, will download and use again
and again and again.

My purpose is I have a main application and according to the logged user, I
ll perform above issue and show a form to user (lots of other forms (class
libs) will be available)

Possible ?

Thanks a Lot
 
F

Family Tree Mike

Well, it looks like your code could use WebClient.DownloadData(url) to get
the dll as an array of bytes, then call Assembly.Load(byte []) to load it.
I've never tried this though, but it seems possible. I've got to believe
there are some security settings that would prevent it though.
 
C

Coder

Thanks for your reply,

You show me a good way but I ll try to do using webservice (returns byte[]
array) instead of downloading dll file, cos I ll use dll based
authentication and planning my web service accept some parameters (usercode,
pass, dllname, etc..) and gives me desired dll as bytearray, every dll will
have same method like ( showsomething() ) and main app will call it.

I ll track the logs on my web service side

Thanks for all, researching in progress :)



Family Tree Mike said:
Well, it looks like your code could use WebClient.DownloadData(url) to get
the dll as an array of bytes, then call Assembly.Load(byte []) to load it.
I've never tried this though, but it seems possible. I've got to believe
there are some security settings that would prevent it though.

Coder said:
After deploying main application using Clickonce,

Is this possible for this dot net application to download a class library
from an ftp or http location (as only one dll) and to use it just in
memory (I dont like to save it somewhere, just load into memory and use
it) ? Next time someome want s to use that class library, will download
and use again and again and again.

My purpose is I have a main application and according to the logged user,
I ll perform above issue and show a form to user (lots of other forms
(class libs) will be available)

Possible ?

Thanks a Lot
 
F

Family Tree Mike

The web service is fine, but to clarify, my security concern was that the
client machine would let code be executed from a byte array not stored
locally.

Coder said:
Thanks for your reply,

You show me a good way but I ll try to do using webservice (returns byte[]
array) instead of downloading dll file, cos I ll use dll based
authentication and planning my web service accept some parameters
(usercode, pass, dllname, etc..) and gives me desired dll as bytearray,
every dll will have same method like ( showsomething() ) and main app will
call it.

I ll track the logs on my web service side

Thanks for all, researching in progress :)



Family Tree Mike said:
Well, it looks like your code could use WebClient.DownloadData(url) to
get the dll as an array of bytes, then call Assembly.Load(byte []) to
load it. I've never tried this though, but it seems possible. I've got
to believe there are some security settings that would prevent it
though.

Coder said:
After deploying main application using Clickonce,

Is this possible for this dot net application to download a class
library from an ftp or http location (as only one dll) and to use it
just in memory (I dont like to save it somewhere, just load into memory
and use it) ? Next time someome want s to use that class library, will
download and use again and again and again.

My purpose is I have a main application and according to the logged
user, I ll perform above issue and show a form to user (lots of other
forms (class libs) will be available)

Possible ?

Thanks a Lot
 
C

Coder

I ll try this issue, and really curious about it :)


Family Tree Mike said:
The web service is fine, but to clarify, my security concern was that the
client machine would let code be executed from a byte array not stored
locally.

Coder said:
Thanks for your reply,

You show me a good way but I ll try to do using webservice (returns
byte[] array) instead of downloading dll file, cos I ll use dll based
authentication and planning my web service accept some parameters
(usercode, pass, dllname, etc..) and gives me desired dll as bytearray,
every dll will have same method like ( showsomething() ) and main app
will call it.

I ll track the logs on my web service side

Thanks for all, researching in progress :)



Family Tree Mike said:
Well, it looks like your code could use WebClient.DownloadData(url) to
get the dll as an array of bytes, then call Assembly.Load(byte []) to
load it. I've never tried this though, but it seems possible. I've got
to believe there are some security settings that would prevent it
though.

After deploying main application using Clickonce,

Is this possible for this dot net application to download a class
library from an ftp or http location (as only one dll) and to use it
just in memory (I dont like to save it somewhere, just load into memory
and use it) ? Next time someome want s to use that class library, will
download and use again and again and again.

My purpose is I have a main application and according to the logged
user, I ll perform above issue and show a form to user (lots of other
forms (class libs) will be available)

Possible ?

Thanks a Lot
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top