George Georgiou George Georgiou - 2 months ago 19
C# Question

I need people's opinion on how to update a ClickOnce application through FTP

I have a C# application which is run through a database, and it is being used by different people in different locations.

The easiest and best way to update my application every time there is a change was to create a ClickOnce application and publish it to a server. My problem is that the only server I can have is an FTP server and the problem here is that ClickOnce doesn't support to get updates from the FTP server. It supports updating to a file share or web hosting.

So I need some opinion on how should I update my application. Is there a chance to access the FTP server through HTTP? For example, instead of typing myftp server to type in something like ftp through http, and it will redirect to the FTP server. This would save all the hustle.

By the way are there people using 45.webmasters.com as a webhosting service? It is my webhosting service and I can store items files on the website. Like I can create a directory and save the application's files in there, but I don't know how to access this directory programmatically so that to publish in that location.

Answer

Do you have to use your server?

If not I suggest you look into using Dropbox as your hoster - it's free, your application is available through HTTP and publishing it is as easy as publishing it to your local Dropbox folder.

I've been using this method for some time now. Of course you can use other services - or maybe a free webhoster. (AppHarbor comes to mind.)

In case the link in the comment doesn't work any more, the key points to get this to work are:

  1. Find your public URL (left click any file in your Dropbox, copy public link), it will start with "http://dl.dropbox.com/u/xxxxxx/".
  2. Open the "Publish"-tab in your projects properties in Visual Studio.
    • As "Publishing Folder Location" use the local path to your Dropbox (subfolder), which usually under Windows 7 looks similar to C:/Users/<User>/My Dropbox/Public (you can use any subfolder you want)
    • "Installation Folder Location": Point it to http://dl.dropbox.com/u/xxxxxx/< subfolders >
    • "Update Location": Same deal as above, http://dl.dropbox.com/u/xxxxxx/< subfolders >
  3. Hit Publish
  4. Now copy your public link from Dropbox to your .application file and start distributing.

Blogpost by Michael S. Clark describing the procedure.