Pete,
It's not all that difficult ... perhaps the articles looked too complicated and you missed the underlying concept. Basically, you simply need to use the Assembly.LoadFrom method from the System.Reflection class to load your DLLs. It's as simple as that.
Ideally, you should architect your application so that there is a small, lightweight executable installed on the client machine. This executable need not contain much in the way of core logic. Ideally, it just references the DLLs it needs, which reside out on a remote Web server and which supply all of the necessary application logic. We use a Outlook-style sidebar to launch all our modules and they are all loaded through Reflection.
If you haven't architected your application that way to begin with, you could add something to your app to do it after the fact (how you implement this is up to you ... you could have a special form that requires the user to start the download process, or you could do it automatically every time you start the app (could take awhile, depending on how many DLLs you have). But, anyway, here's basically all you need:
public class AssembliesList : ArrayList
{
public AssembliesList()
{
this.Add("MyMainControl.DLL");
this.Add("MyBusiness.DLL");
this.Add("SomeOtherOnes.DLL");
}
}
private void DownloadAssemblies()
{
string URL = GetTheURLWhereYourAssembliesAreLocated();
string DLL;
AssembliesList oList = new AssembliesList();
for (int i = 0; i < oList.Count; i++)
{
DLL = oList[i].ToString().Trim();
try
{
System.Reflection.Assembly o =
System.Reflection.Assembly.LoadFrom(URL + DLL);
}
catch (System.Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
~~Bonnie
>Hello Bonny, thank's for your reply but I think the "smart client" route is a bit over the top for my needs, all I want to be able to do is have a central access point for certain classes - surely this must be doable more easily than sm ? thanks again