How do I configure a .net core API to work in IIS?

后端 未结 2 1756
抹茶落季
抹茶落季 2020-11-28 16:14

I\'ve got a .net core API created in Visual Studio 2017 that\'s working fine. When I go to deploy it I get error message HTTP Error 500.19 with error code 0x8007000d. I\'v

相关标签:
2条回答
  • 2020-11-28 16:39

    First of all, you need to install ASP.NET Core Module in web server. Here is the download link.

    Then install either SDK or Runtime in web server.

    Trouble Shooting

    If it still doesn't work, open a command prompt. Navigate to the web application folder and type dotnet YOUR_APP.dll. You should see something like this -

    C:\APIs> dotnet YOUR_APP.dll
    Hosting environment: Production
    Content root path: C:\APIs
    Now listening on: http://localhost:5000
    Application started: Press Ctrl+C to shut down.
    

    It means your application can run in the web server without IIS. Then you need to trouble shoot in IIS or some other things.

    0 讨论(0)
  • 2020-11-28 16:57

    You would need the hosting bundle to be installed on IIS

    https://dotnet.microsoft.com/download/dotnet-core

    Steps :

    1. click the preferred version
    2. Search for 'Hosting Bundle' word (should be on the right side)
    3. Install the same
    4. re-start IIS. And validate your site and see the magic

    Why Hosting bundle is needed? Check following article https://dotnetcoretutorials.com/2019/12/23/hosting-an-asp-net-core-web-application-in-iis/

    How to check if hosting is installed? How to determine if asp.net core has been installed on a windows server

    0 讨论(0)
提交回复
热议问题