ttmind

Main Navigation

ttmind
  • jim-jams
  • Tech
  • Positive
Login

Login

Facebook Google

OR

Remember me Forgot password?

Don't have account? Signup here.

Sort by Categorys

.Net

PHP

Java

JavaScript

Database

Server

Client Side

Tools

Artificial Intelligence

Cloud

Hybrid Development

Event

Smart City

Education

Security

Scrum

Digital Marketing

APP Development

Business

Internet

Simulation

Art

Network

Microservices

Architecture

Technology

Leadership

    Top Articles

  • How Does Social Media Bring People Together?
    TTMind Author
  • How to read appSettings JSON from Class Library in ASP.NET Core
    Anil Shrestha
  • Printing Support In Asp.Net Core
    TTMind Author
  • HOW TO EXTRACT TEXT FROM IMAGE USING JAVASCRIPT (OCR with Tesseract.js)?
    Prakash Pokhrel
  • Images Upload REST API using ASP.NET Core
    Prakash Pokhrel
  • Related Topic

  • Use of TOP and DISTINCT in SQL SERVER
  • Difference between char, nchar, varchar, and nvarchar in MS SQL Server
  • What's new in SQL Server 2019?
  • Uploading .csv sample table file data to SQL Server
  • SQL Server Stored Procedures: Part-1
  • Tech
  • About Us
  • Contact Us
  • TechHelp
  • PositiveHelp
  • Jim-Jams Help
  • Terms & Conditions

© Copyright ttmind.com

Main Content

Hosting ASP.NET Core Web API on IIS

Server IIS Server about 7 years ago || 7/13/2018 || 12.5 K View

  • Hide

This article will help you to host ASP.NET core Web API in IIS by using Visual Studio.

Asp.net core web application deployment is not the same as Asp.Net, there are some few more components that are needed with hosting your asp.net core 2.0 applications on IIS. Before deploying, you must install a bundle which is required to host Asp.Net Core 2.0 application on IIS and that is, .Net Core Windows Server Hosting. This bundle will install.Net Core Runtime which gives all the necessary libraries at runtime, Net Core Library, and Asp.Net Core Module.

Download Link for “Microsoft .Net Core Windows Server Hosting” bundles.

Warning
Please do confirmed you have restarted your computer before moving to the next step after the installation of “Microsoft .Net Core Windows Server Hosting” bundles.

For this demonstration, I am using the same Asp.Net Core 2.0 web API (Image Uploads) which I have built in the previous article. To learn how to create Image Upload Rest API in Asp.net core, please refer to the following article:

Images Upload REST API using ASP.NET Core

Let’s open your project on visual studio.

Steps:

  • Right click on your project and click on Publish.

 

  • Select folder that you want to store your published file. Here I am going to store my published file on F:\ImageUploadDemo.

  • Click on publish. 

 

  • It takes some time to publish your Web Application.

Host WebAPI in IIS

  • Open IIS manager by clicking Windows start -> Search IIS and open it.
  • If IIS is not installed on your Computer click here to install.

Now, go to IIS manager and right click on sites and select Add Web site.

Enter details as shown in below screenshot

  • Enter site name as ImageUploadAPI
  • Change the application pool to DefaultAppPool
  • Select the physical path of folder which contains published ASP.NET Web API. I entered as F:\ImageUploadDemo
  • Enter port number on you wish to host API. I use port as 8084.
  • And click on ok

Browse ASP.NET Core Web API through IIS

Your Web API are now hosted in IIS. Now You can browse it through IIS or browser.

From IIS manager -> Select Sites -> right click on ImageUploadAPI (created in previous step) -> Select Manage Web Site-> and select Browse.

It will redirect to http://localhost:8084. As I have wrote in Startup.cs. It will show the message “MVC didn't find anything!”

app.Run(async (context) =>
{
await context.Response.WriteAsync("MVC didn't find anything!");
});

Summary:

In this article, we learned how to host our asp.net core web API on IIS. 

Happy Coding!!!

  • 4
  • 0
  • 0
    • Facebook
    • Twitter
    • Google +
    • LinkedIn

About author

Prakash Pokhrel

Prakash Pokhrel

https://np.linkedin.com/in/prakash-pokhrel-42a699a2

Reset Your Password
Enter your email address that you used to register. We'll send you an email with your username and a link to reset your password.

Quick Survey