When deploying a ClickOnce application, the installation folder URL, is there a way to make it relative to the web application directory hosting it?
For instance, for local testing I publish to http://localhost:54592. However, when this web application is deployed, it could be anything from http://www.foo.com to http://www.foo.com/MyVirtualDirectory
I would like the path to find the installer in its current location, and the application after installer has completed to reference the web app host, not the development URL.
Platform: Visual Studio 2010, .NET 4.0, and C#.
This works out of the box if you stick with
*.applicationas your application source. You just need to pick a folder inside your web application to publish your ClickOnce application, and the application is available from this address under your application.For example, if copy your site to
C:\inetpub\wwwroot\mysiteand copy the ClickOnce toC:\inetpub\wwwroot\mysite\myappwithMyClickOnce.applicationinside the ClickOnce folder.Then you expose your website as
http://example.comand the ClickOnce application is available underhttp://example.com/myapp/MyClickOnce.application.In case of
setup.exeyou need to recreate the manifest after you publish it to the destination location. This is done withmage.exe.