views:

3640

answers:

2

We have a WPF Application that has a two flavors with a consistent UI etc,one that runs from a Windows OS Desktop and one that is supposed to run as an XBAP application.

Currently I am publishing the XBAP application to my localhost machine IIS (Windows XP Pro),Also I have enabled full trust in my scenario as it is needed(Microsoft .NET Framework 2.0 Configuration,URL Full trust) + pfx file(for my machine name) that gets installed when a user on another machine types the URL from the IE browser on his machine.

Say I want to sell the XBAP application to a customer since he wants a centralized app rather than a desktop one then how will I go about it? Can someone with XBAP deployment experience tell me ? Should I make a setup that will set up the application on his web server and that's it? (assuming web server has .net 3.5 sp1) What about pfx and full trust should I tell him to do that ?

+1  A: 

To run the XBAP application, your client also needs to run .NET framework. It's not possible to run XBAPs without .NET Framework installed.

By default only partial trust permission is granted to your application. To enable FullTrust, you either need to grant the permission to your application URL on the client:

caspol -m -ag 1 -url "http://server/app/*" FullTrust -exclusive on

or you could add the security certificate to the client trusted certificates. A step by step guide is available here: How to run WPF - XBAP as Full Trust Application.

Mehrdad Afshari
+2  A: 

I have worked in a similar situation of using ClickOnce as the engine to deploy the binaries as XBAP as well as standard WPF. To install the XBAP website at a customer site, we would have an installer create the virtual directory in IIS and then run a custom step to sign the ClickOnce manifests. This step was necessary as the application needed to access a generated configuration file that contained information about the customer environment.

Here are some notes on issues that I've seen with using XBAP.

  • Dependency of Framework v3.0 or higher on the Client's workstation. (More of a general note when dealing with WPF, as unless you are using a controlled desktop, you may have to deploy this as well)
  • Inexplicably the user's ClickOnce cache would be invalidated, requiring the user to have to clear their cache using: rundll32 %windir%\system32\dfshim.dll CleanOnlineAppCache
  • Bad installation of Framework v3.0/Internet Explorer requires the user's profile to be recreated, dotNet framework to be reinstalled, or Internet Explorer be reinstalled.
  • Poor error messages from ClickOnce when deployments would fail. A lot of times it would report a general Deployment Exception, and the fix would be one of the above steps.
  • When using any authentication in front of the website, such as ASP.Net forms auth, IIS trusted (not on intranet), or a proxy like ISA, there is an issue within the Microsoft stack where IE will not be able to pass authentication to the ClickOnce engine. The problem, is that IE will successfully authenticate, but will be unable to pass the security context to ClickOnce. When ClickOnce tries to deploy the application files, it will have no security context, and authentication will fail.
David H
I was wondering , the XBAP applications configuration file would need to be modified say the database connection string etc...how do I sign the file after? Say I went to the client and changed my configuration file the the XBAP Application wouldn't work right?
abmv
Right. Once you change the configuration file (or any ClickOnce controlled file for that matter) the hash values stored in the ClickOnce manifests would no longer be valid and you would get a clickonce deployment error. This is true for any type of ClickOnce application. In order to allow for this situation, I had a custom install step that would create the configuration and then regenerate the manifests using the Microsoft.Build.Tasks.Deployment.ManifestUtilities namespace.
David H
Q1.Can you please post the code or a link to a working sample for the action in the custom install step.Did you use WiX or added a installer project to do this in Visual Studio?Q2.I am assuming you made the ClickOnce specifically for the customer,am I correct? You had to publish the ClickOnce for the customer URL ie. http://customer_server/your_app?
abmv
A quick Google search can across this blog: http://www.codedstyle.com/signing-and-re-signing-manifests-in-clickonce/It seemed to go into some detail regarding signing and resigning ClickOnce manifests. The custom install step was just a dotNet dll run by Installshield. In regards to the second question, yes part of the install step was to generate all the customer specific pieces needed for ClickOnce and the applications' configuration.
David H