title: Prism 6.1.0 MefBootstrapper's implementation: CreateShell method throws an exception
body: <p>I'm using Prism 6.1.0 for the first time.
  I created a new WPF project just to try the taste of the newest prism.</p>
  
  <p>My shell looks this way:</p>
  
  <pre><code>&lt;Window x:Class="Prism.Shell"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:local="clr-namespace:Prism"
      mc:Ignorable="d"
      Title="Shell"
      Height="300"
      Width="300"&gt;
  &lt;Grid Background="HotPink"&gt;&lt;/Grid&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>using System.ComponentModel.Composition;
  using System.Windows;
  
  namespace Prism
  {
      /// &lt;summary&gt;
      /// Interaction logic for Shell.xaml
      /// &lt;/summary&gt;
      [Export]
      public partial class Shell : Window
      {
          public Shell()
          {
              InitializeComponent();
          }
      }
  }
  </code></pre>
  
  <p>Bootstrapper:</p>
  
  <pre><code>using Prism.Mef;
  using System.ComponentModel.Composition.Hosting;
  using System.Windows;
  
  namespace Prism
  {
      public class MyBootstrapper : MefBootstrapper
      {
          protected override DependencyObject CreateShell()
          {
              return Container.GetExportedValue&lt;Shell&gt;();
          }
          protected override void InitializeShell()
          {
              base.InitializeShell();
              Application.Current.MainWindow = (Window)Shell;
              Application.Current.MainWindow.Show();
          }
          protected override void ConfigureAggregateCatalog()
          {
              base.ConfigureAggregateCatalog();
              AggregateCatalog.Catalogs
                  .Add(new AssemblyCatalog(typeof(MyBootstrapper).Assembly));
          }
      }
  }
  </code></pre>
  
  <p>and App c# code is:</p>
  
  <pre><code>using System.Windows;
  namespace Prism
  {
      /// &lt;summary&gt;
      /// Interaction logic for App.xaml
      /// &lt;/summary&gt;
      public partial class App : Application
      {
          protected override void OnStartup(StartupEventArgs e)
          {
              base.OnStartup(e);
              (new MyBootstrapper()).Run();
          }
      }
  }
  </code></pre>
  
  <p>After this line:
  <a href="https://i.stack.imgur.com/8rshm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8rshm.png" alt="enter image description here"></a>
  I have an exception:
  <strong><em>Exception thrown: 'System.InvalidOperationException' in PresentationCore.dll
  Additional information: The calling thread must be STA, because many UI components require this.</em></strong>
  <a href="https://i.stack.imgur.com/YSp4b.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YSp4b.png" alt="enter image description here"></a></p>
  
  <p>Does someone know how to fix that?</p>