Translate

Sunday, 1 September 2013

WPF Application Deployment

WPF Application Deployment

For the purposes of demonstration, let’s build something vital for procrastinators the
world over: an application to generate excuses. The application was started with the
“Windows Application (WPF)” project template in Visual Studio 2005 and was
implemented with some very simple code. When you run it, it gives you an excuse
from its vast database.

Simple Publishing


For anyone to use this wonderful application, it must be published. The simplest
way to publish your WPF application is by right-clicking on the project in the Solution
Explorer and choosing the Publish option, which will bring up the first page of
the Publish Wizard. It asks you to choose where you’d like to deploy your application, including
to the disk, to a network share, to an FTP server, or to a web site. By default, the
Publish Wizard will assume you want to publish to the Publish subdirectory of your
project directory. Clicking the Next button.Because we’ve chosen to publish to something besides a web site, the Publish Wizard
wants to know how users will access your published application—in other
words, from a URL, from a UNC path, or from some optical media. (If you choose to
publish to a web site, the only way to access the application is from a URL, so it
won’t bother to ask.) We’d like to test web deployment, so we pick that option and
leave the default URL alone. Clicking Next.
For WPF applications, lets us choose whether we’d like this application to
be made available online (when the computer is able to connect to the application’s
URL) as well as offline (when the computer can’t connect to the URL), or whether
you’d like the application to be only available online. These two options correspond
to the ClickOnce terms locally installed and online only, respectively.
It reminds us what we get with a locally installed ClickOnce application (i.e.,
the application will appear in the Start menu and in the Add or Remove Programs
Control Panel). Clicking Finish causes Visual Studio to publish the application to the
filesystem, including a publish.htm file that you can use to test deployment. If you
happen to have an IIS application set up in the same folder to which Visual Studio
publishes, it will launch the publish.htm file for you, 
For simple needs, this is the complete experience for publishing a WPF ClickOnce
locally installed application.

No comments: