How to Host WEB API in IIS?

WEB API

How to Host WEB API in IIS?

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.

Publish Project
Host WEB API

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.

WEB API
Publish Web

next choose Release mode and click on publish. check the files in your given folder path.

WEB API

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.

WEB API

That’s it.Your  Web Api is hosted in IIS. you can access  it using localhost.

Share this post

Comment (1)

Leave a Reply

Your email address will not be published. Required fields are marked *