title: Not able to host asp .net web api on IIS
body: <p>This could be a very simple thing, but still I am not able to do this. And there is no similar question on SO</p>
  
  <p>I just want to host my asp .net web api over the IIS. I was working with web application years back and this used to be a trivial thing to host a web application (not sure how to host web api).</p>
  
  <p>Please note that when I hit F5 and directly run it from visual studio, then it is correctly getting hosted on IIS express at this address : <a href="http://localhost:40343/api/values" rel="nofollow noreferrer">http://localhost:40343/api/values</a></p>
  
  <p>I have the default web api created from the asp .net 5 web api template and I have the controller class the following location:</p>
  
  <p>C:\NewLaptopWorkspace\ExRestAPI\src\ExRestAPI\Controllers</p>
  
  <p>Steps I am following:</p>
  
  <ol>
  <li>Enabling IIS on my system.</li>
  <li>Publishing my web api from visual studio using the right click and publish option (I am not sure if this step is even required, I followed this from some of the web tutorial). I am giving the path to publish as : C:\NewLaptopWorkspace\ExRestAPI</li>
  <li>Adding a website from the IIS. Giving the physical path as the same path where I published my website, i. e. C:\NewLaptopWorkspace\ExRestAPI</li>
  <li><p>Changing the .net framework version from the Application Pool to .net 4</p></li>
  <li><p>Now when I try to browse, I get the following error (Please check url, path etc in screen shot below):</p></li>
  </ol>
  
  <p><a href="https://i.stack.imgur.com/T5lMA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/T5lMA.png" alt="enter image description here"></a></p>
  
  <p>Could someone please help out with this!</p>