title: Inconsistency when calling in-proc registration-free com servcer from c#
body: <p>I've encountered strange behavior when using registration-free com component. Here is what i have:</p>
  
  <ol>
  <li>Com component. I dont know what threading model it is designed for
  as i dont have source codes, but it works in STA for sure.</li>
  <li>Manifest for that com-component (manifestA)</li>
  <li>c# application (wpf, vs2010, ui thread is sta)</li>
  </ol>
  
  <p>Following code is used to instantiate server:</p>
  
  <pre><code>var t = new Thread(CreateServer) { Name = "Server", IsBackground = true };
  t.SetApartmentState(ApartmentState.STA);
  t.Start();
  </code></pre>
  
  <p>CreateServer is as follows:</p>
  
  <pre><code> public static void CreateServer()
    {
      Service = new Service();
      Service.Connect();
      /* start message queue*/
      Dispatcher.Run();
    }
  </code></pre>
  
  <p>code in wpf application:</p>
  
  <pre><code>new Thread(() =&gt; { GetServer().DoStuff(); }.Start();
  </code></pre>
  
  <p>So when i run an application, com methods are actually runs on main STA thread and blocks UI.</p>
  
  <p>Now if i set threadingModel="Apartment" in manifestA it wont affect anything. But if <b>recompile</b> application after changing threading model, com server starts to works on dedicated thread.</p>
  
  <p>I searched a lot but could not find why this is happening. Why manifestA takes affect during compilation only?</p>
  
  <p>Any ideas?</p>
  
  <p>Thank you</p>