Publishing and hosting Web API developed in .net core through IIS

CrazyCoder

I have WEB API developed in .net core (VS 2017) I need to deploy this api in IIS. This is the procedure I have followed.

  1. Open VS 2017, open the project -> right click on API , click on Publish.
  2. Selected File System -> Give a path where binaries where to be placed-> Click on Publish button.

After it is finished , there are some files in the physical path. I have copied the files on to the server where it is supposed to be hosted.

In the server, this is what I have done.

  1. Installed .Net core run time.
  2. Opened IIS , right click on default website -> Add Application -> Give name of application (say ABC) -> give physical path (where binaries are copied)-> Click OK.

There is a simple Get method in the API for now, where it just returns a string.

Say if the IP address of the server is 10.1.1.1 , this is the URL I'm using.

http://10.1.1.1/ABC/api/GetData

I'm trying this through postman. I'm getting 500 Internal server error.

When I follow the same process for Web API developed in .Net framework, it is working perrfectly fine.

Is there any step which I'm missing for .net core which I have to do.

Any help in this regard is highly appreciated.

Mohsin Mehmood

You need to ensure the following:

  1. .NET core hosting bundle is installed on the server
  2. Your application pool .NET CLR version is set to “No Managed Code”

For details check https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-2.2

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Publishing .NET Core web api/angular application to IIS

分類Dev

Hosting Web API in .Net Core Worker Service - cannot reference IWebHostEnvironment

分類Dev

.NET Core Web API / AngularアプリケーションをIISに公開する

分類Dev

Cannot launch asp.net core web app in IIS Express

分類Dev

.NET Core Web APIキー

分類Dev

.NET core web api with queue processing

分類Dev

SignalR with web Api as client [.Net Core]

分類Dev

Publishing a shared appsettings file with .net core

分類Dev

ASP.NET Core 2.2 Web APIは、IISでホストした後に404を提供します

分類Dev

Hosting ASP.NET in IIS7 gives Access is denied?

分類Dev

web.configを使用しないIISでのHostRest API Core

分類Dev

Return "raw" json in ASP.NET Core 2.0 Web Api

分類Dev

Unable to get request header in asp net core web API

分類Dev

ASP.NET Core Web APIの例外処理

分類Dev

ASP.NET Core Web API認証

分類Dev

Accept x-www-form-urlencoded in Web API .Net Core

分類Dev

Angular Post json to .net core web api is null

分類Dev

.net Core 2.0 web api 400 error using Validateantiforgerytoken

分類Dev

Cutomize Swagger UI ASP.NET Core Web API

分類Dev

passing an array to a asp net core web api action method HttpGet

分類Dev

Implement Pagination in ASP.NET Core 2.1 Web API

分類Dev

ASP.NET Core Web API FacebookJWT認証

分類Dev

Web APIのAuthorizeAttribute(ASP.NET Core 2)

分類Dev

Return string from Web API .NET Core get operation

分類Dev

Unhandled Exception in ASP.Net Core Web API on Linux

分類Dev

Angular 2 & .NET Core Web API HttpPost の問題

分類Dev

C#.net Core web Api Get request#parameter

分類Dev

How to host ASP.NET Web API 2 project on IIS 10

分類Dev

In Azure Service Fabric, what is the deference between a Stateless Web API and the ASP.NET Core Web API?

Related 関連記事

  1. 1

    Publishing .NET Core web api/angular application to IIS

  2. 2

    Hosting Web API in .Net Core Worker Service - cannot reference IWebHostEnvironment

  3. 3

    .NET Core Web API / AngularアプリケーションをIISに公開する

  4. 4

    Cannot launch asp.net core web app in IIS Express

  5. 5

    .NET Core Web APIキー

  6. 6

    .NET core web api with queue processing

  7. 7

    SignalR with web Api as client [.Net Core]

  8. 8

    Publishing a shared appsettings file with .net core

  9. 9

    ASP.NET Core 2.2 Web APIは、IISでホストした後に404を提供します

  10. 10

    Hosting ASP.NET in IIS7 gives Access is denied?

  11. 11

    web.configを使用しないIISでのHostRest API Core

  12. 12

    Return "raw" json in ASP.NET Core 2.0 Web Api

  13. 13

    Unable to get request header in asp net core web API

  14. 14

    ASP.NET Core Web APIの例外処理

  15. 15

    ASP.NET Core Web API認証

  16. 16

    Accept x-www-form-urlencoded in Web API .Net Core

  17. 17

    Angular Post json to .net core web api is null

  18. 18

    .net Core 2.0 web api 400 error using Validateantiforgerytoken

  19. 19

    Cutomize Swagger UI ASP.NET Core Web API

  20. 20

    passing an array to a asp net core web api action method HttpGet

  21. 21

    Implement Pagination in ASP.NET Core 2.1 Web API

  22. 22

    ASP.NET Core Web API FacebookJWT認証

  23. 23

    Web APIのAuthorizeAttribute(ASP.NET Core 2)

  24. 24

    Return string from Web API .NET Core get operation

  25. 25

    Unhandled Exception in ASP.Net Core Web API on Linux

  26. 26

    Angular 2 & .NET Core Web API HttpPost の問題

  27. 27

    C#.net Core web Api Get request#parameter

  28. 28

    How to host ASP.NET Web API 2 project on IIS 10

  29. 29

    In Azure Service Fabric, what is the deference between a Stateless Web API and the ASP.NET Core Web API?

ホットタグ

アーカイブ