ClickOnce publish to a non available URLs

If you are publishing an application with ClickOnce you may not have the final URL for the deployment site e.g. you are planning to use but you have no access now, this happens to us quite oftan as a software house when we are developing something that will be deployed with ClickOnce within a client’s network.

You can of course publish to you local machine but the problem is the temporary URL you use to deploy is stored in the ClickOnce manifest, which has a checksum so you cannot edit it by hand.

To get round this we have done the following:

  1. In the c:\windows\system32\etc\drv\hosts add with the IP address
  2. You can now try to deploy to, but it fails with a 401 security error (maybe giving you a login box that does not work)
  3. To address this use workround 1 in;…, this allow URLs other than localhost to work as loopback, basically you add a registry key to disable the loopback check
  4. After a reboot you can now deploy to, you may get a login box, but yoy can now use any valid login for the box.
  5. Once this is done the publish works locally, and if you look in the manifest you see the right URL. You can then ship off the whole directory to the live site as required

Leave a Reply

Your email address will not be published.