Re: [2005] File Write hangs
I would double check the logic and do a possible redesign/move some code if needed to make sure the stream gets closed.
Other than that, maybe turn Autoflush on the streamwriter to True, which will flush the buffer after every write. Won't fix your issue, but will output to the file after each write instead of waiting for the stream to fully close.
You may be able to open, write, and close the streamwriter each time as needed depending on your application if it is not constantly needed to write. But constantly doing that would get expensive.
Also, just curious. Why are you assigning computed values to variables, but then in the writeline you are re-computing them? Why not just use the variables you just assigned to? Just seemed like an interesting way of doing it, just wondering, but I'm sure you have your reason.
Wish I could be of more help.
Re: [2005] File Write hangs
I don't think I do have a good reason for recalculating the same values over again.
looking at some of the code it does seem more inefficient than I would like to begin with, I wrote this code probably around 8 months ago. This problem only seems to be somewhat recent, as I've made changes to the supporting libraries and some to other sections of code in this project.
This section of code happens only once, in the main form's load. There are 3 other instances of this same app that run around the same time so that may have something to do with it.