title: Method not allowed 405 when using IIS
body: <p>I have the following WCF :</p>
  
  <pre><code>    [OperationContract]
      IList&lt;OperationRoomDto&gt; GetOperationRooms();
  </code></pre>
  
  <p>and I have a website that uses this WCF, when I use Visual studio (Asp.Net development server) it works fine, but when I deploy the WCF to IIS I get this exception:</p>
  
  <blockquote>
    <p>The remote server returned an error: (405) Method Not Allowed.</p>
  </blockquote>
  
  <p>I made a simple website to test this WCF (on IIS) and It worked.</p>
  
  <p>this is a part of the website web.config file:</p>
  
  <pre><code>  &lt;endpoint address="http://server/WcfService"
              binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IMessageService"
              contract="MyProject.Web.Wcf.IMessageService" name="BasicHttpBinding_IMessageService"&gt;
    &lt;/endpoint&gt;
  </code></pre>
  
  <p>and this part of the web service config file:</p>
  
  <pre><code>  &lt;system.serviceModel&gt;
  &lt;behaviors&gt;
    &lt;serviceBehaviors&gt;
      &lt;behavior&gt;
        &lt;!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --&gt;
        &lt;serviceMetadata httpGetEnabled="true" /&gt;
        &lt;!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information --&gt;
        &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt;
      &lt;/behavior&gt;
    &lt;/serviceBehaviors&gt;
  &lt;/behaviors&gt;
  &lt;serviceHostingEnvironment multipleSiteBindingsEnabled="true" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>I tried to debug the w3wp.exe service to get any hidden exception,I put a break point at the web service methods, but the debugger didn't even reach there, and the exception happened before reaching to the web service class.</p>