title: WebApplication works fine on IIS Express but it doesn't on Local IIS
body: <p>I have a problem with my web application. I develop using VS 2013 (run as Administrator) and Windows 8.</p>
  
  <p>When I debug using IIS Express - everything works fine, without any errors (I run VS as Administrator). When I change project properties to use Local IIS (it's installed) - I cannot use external library which is placed in GAC (Microsoft.FlightSimulator.SimConnect). Also I run VS as Administrator.
  Thrown error: "HRESULT E_FAIL has been returned from a call to a COM component" - this says nothing to me. This is thrown during creating new SimConnect object:<br/>
  <code>var simconnect = new SimConnect(...)</code> <br/>
  OFC, to use SimConnect, firstly Microsoft Flight Simulator should be launched (and it's started). This was proposed reason of the problem which I found in the Internet - second one was granting permissions (described below).</p>
  
  <p>Details:
  I have two projects in solution: library project (which is used to connect to the FSX) and web project (MVC - to present the results). <br/>
  1) I tried to move whole library project content to the MVC project - nothing.<br/>
  2) I used IIS manager to publish my website (with the seperate AppPool) - result the same as for Local IIS.<br/>
  3) I granted permissions to the folder (where projects are placed) for my own AppPool and also for IUSR, IIS_IUSR and DefaultAppPool - full access. And nothing. <br/>
  4) I ran FSX as Administrator - also nothing :/</p>
  
  <p>I found the workaround: I moved the library project to the another project - console application where I used HttpSelfHostConfiguration to host that. And later, I call this api from the main project (MVC). For this solution everything works fine (I tested for Local IIS [debugging] and also for IIS Manager). I have to only run the Host Api project as Administrator.</p>
  
  <p>I'm very curious what is the reason of the exception. And additionally: how to resolve that :)</p>
  
  <p>It seems like the problem with the permissions - but I granted to the every used AppPool.<br/>
  Can be the reason lack of permissions for dll in GAC? I don't think so, but I have no idea what to do. If yes, how to grant permissions for dll in GAC (or how to copy that)? <br/></p>