How to Host WEB API in IIS?khushbu Thakkar
We have seen how to create web Api. Now we will see how to host Web Api in IIS.
First open you WEB Api application project. Right click on Project and click on Publish.
Publish Web dialog will open.From that select publish Target as ‘custom ‘ and add your Profile name as shown in below image.
click on next. from next window choose publish method as ” File System” .Select your target location where you want to publish project.
now click on Next.
next choose Release mode and click on publish. check the files in your given folder path.
select that folder copy it and paste it into C:\inetpub\wwwroot .
now open IIS manager you will see your folder in default website.Right click on that folder and click on convert to application.
That’s it.Your Web Api is hosted in IIS. you can access it using localhost.