Assembly.LoadFrom when offline

  • Thread starter Thread starter Greg Bacchus
  • Start date Start date
G

Greg Bacchus

Hi,
Does anyone know how to get an offline reference to an assembly that has
been downloaded using Assembly.LoadFrom.

E.g. Application downloads the assembly while it in online... next time it
is run it is offline and needs to still use that same assembly.
Assembly.LoadFrom throws an exception.

Cheers,
Greg
 
Hi Greg,

You should probably cache the downloaded assembly locally.
If your app is online, check for cached version availability, then,
optionally, check for a newer version available online. If the assembly is
available in the cache [and there is no newer version], use it from the
cache.

If your app is offline, check the cache. If the assembly is there, load it
from disk and proceed. If it is not there - prompt the user to go online to
download missing components.

P.S. Most of this burden can be laid on the framework if you use so-called
No Touch Deployment. The framework utilizes a facility known as Downloaded
Assembly Cache then to store downloaded assemblies on disk.
 
The downloaded assembly IS cached locally (as you say in the assembly cache)
but how do I reference it from there? I was hoping that it would be
intelligent enough to automatically look in the download cache by itself
when I referenced the web assembly!! The advantage with this is it then
automatically handles trickel deployment. So if that assembly references
another assembly that does not exist, the framework automatically looks in
the referenced location of the first one - on the web. You see this wouldn't
work if I have to make a local reference to the assembly.
Greg


Dmitriy Lapshin said:
Hi Greg,

You should probably cache the downloaded assembly locally.
If your app is online, check for cached version availability, then,
optionally, check for a newer version available online. If the assembly is
available in the cache [and there is no newer version], use it from the
cache.

If your app is offline, check the cache. If the assembly is there, load it
from disk and proceed. If it is not there - prompt the user to go online to
download missing components.

P.S. Most of this burden can be laid on the framework if you use so-called
No Touch Deployment. The framework utilizes a facility known as Downloaded
Assembly Cache then to store downloaded assemblies on disk.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://www.x-unity.net/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

Greg Bacchus said:
Hi,
Does anyone know how to get an offline reference to an assembly that has
been downloaded using Assembly.LoadFrom.

E.g. Application downloads the assembly while it in online... next time it
is run it is offline and needs to still use that same assembly.
Assembly.LoadFrom throws an exception.

Cheers,
Greg
 
Back
Top