I've developed a pretty large vb.net 2.0 application. I wrote its own updater function using the webclient class. I post the new build on the server, up the version in a little version file and leave it at that.
The application (which is originally deployed with an installer) will check that text file on the webserver, if the version is larger, it will download the new exe, rename itself to old, rename the new exe to the original filename, then do an application.restart. upon restart the old file gets deleted. Works just fine on my dev machine.
On every one of my outside test machines (outside my network) I get the following error AFTER the new file has been downloaded, ran, and my "about" form is shown
************** Exception Text **************
System.InvalidOperationException: An error occurred creating the form. See Exception.InnerException for details. The error is: Invalid token. ---> System.BadImageFormatException: Invalid token.
at FOE.frmAbout.InitializeComponent()
at FOE.frmAbout..ctor()
--- End of inner exception stack trace ---
at FOE.My.MyProject.MyForms.Create__Instance__[T](T Instance)
at FOE.Form1.AboutToolStripMenuItem_Click(Object sender, EventArgs e)
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.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)
thing is, every one of my other forms (10 or so) load fine. its just this ONE form will not load, and it throws the above exception.
So I took that downloaded file and did a hex comparison to the same build on my machine and found a few bytes to be different in two parts of the file. Also, I opened the "broken" exe with reflector and when i tried to view the frmAbout form the decompiler thew an exception as well.
I've rebuilt my application 3-4 different times, everytime its downloaded remotely, that area of it gets ... broken. If i zip it up that problem goes away (then i have to add the ability to unzip to my application to continue using the automatic update feature).
I have searched the web high and low and can not find anyone with this same problem. would someone please explain to me what exactly is going on and how i should go about getting around it?
If anyone things its a web server issue, im running 2000 with IIS5, and have old vb6 apps with similar autoupdate features built in that work fine (among the other 3-4 websites we host as well)...
anyways, i look forward to hearing someones opinion.
thanks.
The application (which is originally deployed with an installer) will check that text file on the webserver, if the version is larger, it will download the new exe, rename itself to old, rename the new exe to the original filename, then do an application.restart. upon restart the old file gets deleted. Works just fine on my dev machine.
On every one of my outside test machines (outside my network) I get the following error AFTER the new file has been downloaded, ran, and my "about" form is shown
************** Exception Text **************
System.InvalidOperationException: An error occurred creating the form. See Exception.InnerException for details. The error is: Invalid token. ---> System.BadImageFormatException: Invalid token.
at FOE.frmAbout.InitializeComponent()
at FOE.frmAbout..ctor()
--- End of inner exception stack trace ---
at FOE.My.MyProject.MyForms.Create__Instance__[T](T Instance)
at FOE.Form1.AboutToolStripMenuItem_Click(Object sender, EventArgs e)
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.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)
thing is, every one of my other forms (10 or so) load fine. its just this ONE form will not load, and it throws the above exception.
So I took that downloaded file and did a hex comparison to the same build on my machine and found a few bytes to be different in two parts of the file. Also, I opened the "broken" exe with reflector and when i tried to view the frmAbout form the decompiler thew an exception as well.
I've rebuilt my application 3-4 different times, everytime its downloaded remotely, that area of it gets ... broken. If i zip it up that problem goes away (then i have to add the ability to unzip to my application to continue using the automatic update feature).
I have searched the web high and low and can not find anyone with this same problem. would someone please explain to me what exactly is going on and how i should go about getting around it?
If anyone things its a web server issue, im running 2000 with IIS5, and have old vb6 apps with similar autoupdate features built in that work fine (among the other 3-4 websites we host as well)...
anyways, i look forward to hearing someones opinion.
thanks.