Hi Bob,
Thank you for clarifying the question.
>REQUIREMENT: I need a way to programmatically download assemblies for the "pluggable" components [on demand].
Yes, you can use WCF to download files from server. Here is a good sample talking about this.
http://www.codeproject.com/KB/WCF/WCF_FileTransfer_Progress.aspx
It declares an IFileTransferService interface and a DownloadFile method. The DownloadRequest class holds the file name. You can look into the sample code and find the following method.
public long DownloadFile(ref string FileName, out System.IO.Stream FileByteStream)
{
Client.FileTransferClient.DownloadRequest inValue = new Client.FileTransferClient.DownloadRequest();
inValue.FileName = FileName;
Client.FileTransferClient.RemoteFileInfo retVal = ((Client.FileTransferClient.IFileTransferService)(this)).DownloadFile(inValue);
FileName = retVal.FileName;
FileByteStream = retVal.FileByteStream;
return retVal.Length;
}
Once you want to download a file, you can call DownloadFile method and pass FileName, FileByteStream. If you want to know more about WCF technology, you can post the question on the WCF forums. The experts on that forum are more professional on WCF technology.
>QUESTION: What is the recommended way to do this in a client WPF app? Can ClickOnce do this, or is it better to do this assembly loading myself?
As Robin and I have said ClickOnce doesn’t support that function. However you can still publish your main app with ClickOnce. That app only contains necessary assemblies to start your first form. After that form being shown, you can download components via WCF based on the user’s choice.
Hope I have not misunderstood you this time. If you have anything unclear, please feel free to tell me.
Sincerely,
Kira Qian
Send us any feedback you have about the help from MSFT at fbmsdn@microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the
All-In-One Code Framework!