title: My Entity Framework Core API works fine locally, but fails with a 405 error in production
body: <p>I have a .NetCore 3.1 API project that uses Entity Framework.</p>
  
  <p>It is working perfectly when I run it locally from Visual Studio.</p>
  
  <p>However, after publishing to a production IIS 8.5 server, I get the following errors when I try to hit an API that uses PUT on the production server.</p>
  
  <blockquote>
    <p>xhr.js:178 PUT <a href="https://nationalparks.xyz.gov/api/plants/91" rel="nofollow noreferrer">https://nationalparks.xyz.gov/api/plants/91</a> 405 (Method
    Not Allowed)</p>
  </blockquote>
  
  <p>My controller begins like this:</p>
  
  <pre><code>    [HttpPut("{id}")]
      public async Task&lt;IActionResult&gt; PutPlant(long id, [FromBody] Plant plant)
      {
        ...
      }
  </code></pre>
  
  <p>And client-side looks like this:    </p>
  
  <pre><code>    await axios({
          method: "PUT",
          url: "api/plants/" + plant.id,
          data: JSON.stringify(plant),
          headers: { 'Content-Type': 'application/json; charset=utf-8' }
      });
  </code></pre>
  
  <p>Honestly I'm stumped...I'm not sure why it's doing that.</p>
  
  <p>I've seen a few posts saying to modify the web.config, but my app uses appsettings.json, not a web.config.</p>
  
  <p>Any ideas?</p>
  
  <p>Thanks!</p>