Here's another spin...
I put together a trivial Windows Forms app with a multiline textbox to print trace text, and a button whose click handler simply calls the ClickOnce API exactly as we do in the production app. When I run the sample app on XP Pro and click the button, everything executes fine. When I run the sample app on our tablets and click the button, CheckForUpdate() throws an InvalidOperationException with a trace as follows:
System.InvalidOperationException: Application cannot be updated programmatically unless the deployment manifest includes the <deploymentProvider> element.
at System.Deployment.Application.ApplicationDeployment.CheckForDetailedUpdate()
at System.Deployment.Application.ApplicationDeployment.CheckForUpdate()
at Updater.Form1.btnUpdate_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
So, just to humor, I built a new deployment manifest that includes the deploymentProvider element, and it now works fine on the tablets and still works fine on the XP Pro machines. So, now I have what seems to be a workaround for the time being.
Here are the outstanding issues:
Whywould the deploymentProvider need to be explicitly defined, as opposed to defaulting to the same (deployment manifest) file that was launched? I can understand why it's useful if yo uwant to look for updates elsewhere for some reason, but if not, why not just default to itself?
If the deploymentProvider element truly must be included for programmatic update, as the exception message implies, why do I only get this exception on the tablet PCsubset of my test contexts?
Thanks.
MEC