Where are you adding the AutomaticUpdater? Is it in the constructor of the form? Also, can you give me a snippet of what your initilaization code looks like (pertaining to the AU)?
I've been having the odd occasional situation:
I'll launch an a form with an automaticUpdater control on it, and I'll see the outline of the window draw but it will have no contents. The window will never draw to completion, and so I have to kill the app. It's reproducible in that it happens occasionally, but not very regularly.
Anway, today I was debugging an app, and the form would show this behavior, then paint, then immediately get disposed of. Fortunately, I was in the debugger and was able to capture this:
System.ObjectDisposedException was unhandled Message=Cannot access a disposed object.Object name: 'FormAnestheticRecord'. Source=System.Windows.Forms ObjectName=FormAnestheticRecord StackTrace: at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous) at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args) at wyDay.Controls.AutomaticUpdater.auBackend_UpdateStepMismatch(Object sender, EventArgs e) at wyDay.Controls.AutomaticUpdaterBackend.updateHelper_UpdateStepMismatch(Object sender, Response respType, UpdateStep previousStep) at wyDay.Controls.UpdateHelper.ProcessReceivedMessage(UpdateHelperData data) at wyDay.Controls.UpdateHelper.SafeProcessReceivedMessage(Byte[] message) at wyDay.Controls.PipeClient.Read() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException:
I tried cleaning out the cache, running wyUpdate manually, and rebooting, but eventually the only way I got this behavior to stop (the form instantaneously disposing of itself) was to delete the AU control from the form and re-add it.
AutomaticUpdater control version is 2.6.13. I'd say I've noticed the window paint problem for about 2 months or so, so maybe it goes back to about 2.6.11
Where are you adding the AutomaticUpdater? Is it in the constructor of the form? Also, can you give me a snippet of what your initilaization code looks like (pertaining to the AU)?
In the constructor. private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormAnestheticRecord)); this.automaticUpdater1 = new wyDay.Controls.AutomaticUpdater(); this.visualStyler1 = new SkinSoft.VisualStyler.VisualStyler(this.components); this.menuStrip1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.automaticUpdater1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.visualStyler1)).BeginInit(); this.SuspendLayout();// // automaticUpdater1 // this.automaticUpdater1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.automaticUpdater1.BackColor = System.Drawing.Color.Transparent; this.automaticUpdater1.ContainerForm = this; this.automaticUpdater1.DaysBetweenChecks = 7; this.automaticUpdater1.GUID = "dbb889d7-9e4f-40b0-ab7d-2b66ad2fa96c"; this.automaticUpdater1.Location = new System.Drawing.Point(875, 8); this.automaticUpdater1.Name = "automaticUpdater1"; this.automaticUpdater1.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.automaticUpdater1.Size = new System.Drawing.Size(16, 16); this.automaticUpdater1.TabIndex = 152; this.automaticUpdater1.ToolStripItem = this.checkForUpdatesToolStripMenuItem; this.automaticUpdater1.wyUpdateCommandline = "";
// FormAnestheticRecord // this.AutoScroll = true; this.ClientSize = new System.Drawing.Size(909, 775); this.Controls.Add(this.butOK); this.Controls.Add(this.labelInvalidSig); this.Controls.Add(this.butCancel); this.Controls.Add(this.automaticUpdater1);[snip] this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MainMenuStrip = this.menuStrip1; this.Name = "FormAnestheticRecord"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Anesthetic Record"; this.Load += new System.EventHandler(this.FormAnestheticRecord_Load); this.contextMenuStrip1.ResumeLayout(false); this.groupBoxSidebarRt.ResumeLayout(false); this.groupBoxSidebarRt.PerformLayout();
[snip] this.menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.automaticUpdater1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.visualStyler1)).EndInit(); this.ResumeLayout(false); this.PerformLayout();
Is this the main form of the app, or is it another form?
Is this the main form of the app, or is it another form?
Well, my main form, as it's part of a plugin. But it's it's the first one launched from the host app, so yes.
I can't reproduce this. Does the app in which you're a plugin have a main form? That is, if your form closes does the entire app close, or is the "main app" form waiting in the wings.
Sam wrote:> Does the app in which you're a plugin have a main form? That is, if your form closes> does the entire app close, or is the "main app" form waiting in the wings.
Yes.
> That is, if your form closes> does the entire app close, or is the "main app" form waiting in the wings
Main app's form is waiting in the wings.