> Hi,
>
[quoted text clipped - 18 lines]
> P.S.: This is a repost from
> microsoft.public.dotnet.framework.windowsforms
You could do the easier thing and change the attribute to STA..
OR..
Spawn a new thread to do the file writing. BE carefull to place the
STA attrbute on the method you pass as the thread start.
this will solve your problem.
As for your question..
My theory is that .net uses legacy components for file dialog and save
dialog.
Stefan - 31 Jan 2008 10:17 GMT
Thanks for your feedback.
I already tried to change back to STA. This does not work.
As my app is still under development it never occured to me to test
the thing as an EXE. There the problem does not exist. It's just when
I run/debug the app within VS IDE. If I disable the debug option "VS
host process" in the app's settings, then it also runs without
exception in the IDE (but then I cannot debug it).
I also found postings about [STAThread] not working (guess this was
correct for older versions of .NET) and the advice to set STA-mode as
the first statement in the main method. All this won't work. The app
is by then already in MTA mode and you just can't change to STA mode
by simply calling SetAppartmentState.
Stefan
> > Hi,
>
[quoted text clipped - 31 lines]
>
> - Zitierten Text anzeigen -