   [C#] [XNA] Windows GUI class requires STA thread.
  When using a OpenFileDialog object to open files from a storage medium, I am required to make my game's main method a single-threaded apartment.   [STAThread]   static void Main(string[] args)   {  using (Game1 game = new Game1())  { game.Run();  }   }I'm not entirely sure if this is wise, should I wish to deploy to the Xbox360 console.Is there any way of running my GUI class in its own STA thread:Thread t = new Thread(new ThreadStart(StartNewStaThread)); t.Start();[STAThread]private void StartNewStaThread() {// GUI class}So the whole application doesn't require [STAThread]?   
  How are you going to open an OpenFileDialog on the Xbox 360?This sounds like a job for preprocessor directives; as far as I can tell, XBOX and XBOX360 are defined by default for XNA projects targeting the Xbox 360.#if !XBOX[STAThread]#endifstatic void Main(string[] args){    using (Game1 game = new Game1())    {   game.Run();    }};  Thanks Ben.Does using [STAThread] affect performance on windows?I was hoping to only have the GUI class use STAThread and not have worry about preprocessor directives.  Would that be possible?   ;  The attribute only works on Main to my knowledge; as for performance, I really couldn't say whether it had any effect or not, sorry. You could try using Thread.SetApartmentState() when creating the GUI thread (Raymond Chen has an article on why this is required).   