Symmetri Developer Blog

August 22, 2009

WPF ClickOnce deployment issues

General, WPF/Silverlight - By Shourov Bhattacharya

So I’ve just deployed my first WPF project via the web using ClickOnce and thought I would share some of the issues that came up. Firstly, the idea behind ClickOnce is great - creating a single web page link that can do the installation of an application and all of its prerequisite software in one go. However, there were a few issues that came up with the publishing using VS2008:

1) the FTP option in the publishing refused to work. I checked the server name and username/password credentials a hundred times, but the publish failed again and again. The error messages aren’t particularly helpful; you really have no way of telling what exactly went wrong. In the end, I decided to publish to a local folder and do the FTP myself. No biggie, but annoying nonetheless.

2) after deploying to a webpage, I decided to check the installation process; I clicked the “Install” button on the generated webpage from a fresh Vista install. After the usual security warnings, the first thing the install did was to install .NET 3.5 SP1. However, it took a really long time - over ten minutes; and the progress bar hardly moved all the time. I am not sure if that is normal, but it seems that I’ll have to make a note of that when deploying to client’s machines; the average user will probably lose hope and lose patience with that kind of wait unless forewarned.

3) next the installation script tried to install the application itself, but I found that it would not install; the error message I got was “The assembly Microsoft.Windows.Design.Extensibility needs to be added to the GAC.” So it seems that there is a required assembly that is not being installed by the ClickOnce process. Checking back in Visual Studio, I noticed that the assembly “Microsoft.WPFToolkit.VisualStudio.Design” was part of the project references; it seemed to me that any library which is specific to Visual Studio should have nothing to do with the deployed application; so I removed and re-published.

4) That got rid of the previous error all right, but now I found that the install complained about missing other assemblies: Microsoft.Data.SqlServerCe.*. My application did indeed use SQL Server Compact Edition 3.5, but it seemed that the install was not checking for it or downloading it.

The issue here is that the project has references to certain assemblies (Microsoft.Data.SqlServerCe.*), but the publishing process does not automatically pick up the prerequisite software associated with those assemblies. The solution is that we must explicitly define those prerequisites. This can be done under Project Properties in Visual Studio under the Publish tab; press the “Prerequisites” button. In my case, I needed to add “SQL Server Compact 3.5″ as a prerequisite to be downloaded by the installation.

Comments »

No comments yet.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Anti-spam measure: please retype the above text into the box provided.

Get free blog up and running in minutes with Blogsome
Theme designed by Janis Joseph