Application Startup Error


Author
Message
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
Several of my users are randomly getting the following error:



Message: An error occurred while creating the main form



Source: MicroFour StrataFrame UI



Inner Exception: System.Reflection.TargetInvocationException: Exception

has been thrown by the target of an invocation. --->

System.IO.FileLoadException: Could not load file or assembly

'DevExpress.XtraNavBar.v8.2, Version=8.2.4.0, Culture=neutral,

PublicKeyToken=9b171c9fd64da1d1' or one of its dependencies. The process

cannot access the file because it is being used by another process.

(Exception from HRESULT: 0x80070020)



File name: 'DevExpress.XtraNavBar.v8.2, Version=8.2.4.0,

Culture=neutral, PublicKeyToken=9b171c9fd64da1d1'

at Aspire.SF.MainForm.InitializeComponent()

at Aspire.SF.MainForm..ctor()



It does not generate the error if the user tries to start the application again. It typically occurs after the application has updated itself (click once procedures). I realize that the assembly referenced is a DevEx assembly, but I was wondering if there was a way to check for this while starting the app and gracefully closing the app or restarting the app without the user getting the unhandled error message.



Thanks!

Bill
Replies
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Bill,



Is the update happening when the user starts the app, or are you initiating the update while the app is running, via the ClickOnce(more) API? Is this a web app?
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
Hi Greg,



I have a small procedure that runs when the Windows Forms app opens to check to see if there is an update available (via ClickOnce structure). I then present a dialog to ask the user if they want to update. If so, the app goes out to the server to retrieve the update, then restarts itself with the new version. 98% of the time, the app restarts without a problem. The other 2% hiccups on the assembly mentioned. A second restart works fine.



I have introduced some trappings in my UnhandledExceptionFound method. Hopefully, those will detect the problem and automatically issue a restart.



If you have any other insight, I would appreciate it.



Thanks,

Bill
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
OK, well at least this makes sense. I wonder if putting a Thread.Sleep() call in there would help to give it time to unload the app (besides an error handling)? Not sure, just a thought.



Also, any reason why you are managing the update when the app opens, rather than just letting ClickOnce handle it?
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search