I am running into a weird problem in my ultra-simple Winforms
application written in C#.
In the Form.Shown event I set a couple of environment variables using
the standard SetEnvironmentV ariable API like so:
Environment.Set EnvironmentVari able("someKey", somevalue,
EnvironmentVari ableTarget.User );
I have 2 such calls. Amazingly it takes nearly 10 seconds for these
two calls to execute! If I comment out these 2 calls and run, the
application is just spiffy and the dialog comes up in no time.
Because it takes 10 seconds for these calls to execute, the dialog
kinda hangs before becoming responsive for that duration of time
(obviously because the UI thread is held up).
Am I doing something wrong?
Comment