Updating VSTO Add-in does not close MS Project gracefullySolved

First off, this product rocks. I love the simplicity and the great walk throughs! 😀

I'm creating a VSTO Microsoft Project add-in using C# .NET 4.0. I've set up the update server and integrated the updater into the application, however I'm having a small issue. When I select "Check for Updates," all goes as expected and the update is downloaded. When I select "Install Now" Project closes and wyUpdate opens and successfully updates the files. HOWEVER, immediately after Project closes I get the Windows 7 message saying "Microsoft Project has stopped working. Check online for a solution / Close the program" and it then attempts to recover data.

Any ideas why it might do this? The update is 100% successful aside from that behavior.

Thanks in advanced!

First off, this product rocks. I love the simplicity and the great walk throughs! 😀

Thanks, we appreciate that.

"Microsoft Project has stopped working. Check online for a solution / Close the program"

I've been looking into this and this looks like a bug with MS Project.

What we're doing when you click "Install Now" is calling "Application.Exit()" to close your app. We haven't had any problems with other apps crashing closed when Application.Exit() is called.

What version of Project are you using (2007 or 2010)? Also, do you have the service packs installed?

Thanks for the reply.

We're using Project 2010, 64bit, version 14.0.4760.1000. This install is on a virtual machine (Win 7, x64).

I'll try it out on a "real" machine, and also play around with using Application.Exit in a test add-in, and post back with my results.

Edit: First set of results: Adding a simple button with "Application.Exit()" causes the same behavior. That blows! If you have any suggestions for workarounds, I'm all ears.

Edit 2:I found a way to close the application without it crashing by using the "FileExit" method directly against the Project object model (http://msdn.microsoft.com/en-us/library/ff865924.aspx).

Now, is there a way to override the default behavior of Install Now? For reference, this how how the closing must be handled: http://pastebin.com/i49KPTza

I'll add the ability for your to specify your own "close handler" for the AutomaticUpdater. I'll send you the fixed AutomaticUpdater tomorrow.

We've added the "CloseAppNow" event to the AutomaitcUpdater 2.6.15 (out soon -- I've sent you an email with the pre-release version attached). Use the CloseAppNow event to exit Microsoft Project gracefully (instead of crashing closed).

Tell me if you have any questions.