Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploy API with DotNet Core to a Windows Server 2008 R2 with IIS

Tags:

iis

.net-core

I am trying to follow a very simple TodoApi tutorials found on here https://learn.microsoft.com/en-us/aspnet/core/tutorials/first-web-api

I could run it as standalone on my local box using

dotnet run <ApplicationName>

Quick test using Postman showed the standalone application is running fine on my local computer. However, when I tried to "deploy" the application to my Windows Server 2008 R2 (I have installed DotNetCore SDK and DotNetCore WindowsHosting in there), I got this error:

enter image description here

By "deploy", I meant xcopying the folder. So my questions here are two folds:

1) Is there a guideline/instruction of how to deploy a standalone api with dotnet core to a different windows server, the prerequisites for the server to be able to host such api application?

2) Is there a guideline to deploy the api to IIS?

Thanks,

like image 919
user1205746 Avatar asked Dec 19 '25 06:12

user1205746


1 Answers

After much researches and head banging against the wall, I've finally found an great article from Rick Stralh that detailed how an Asp.Net Core application should be published and hosted with IIS. I found this article highly, extremely useful and answered to all my questions. I think I would like to share in case others may run into the same issue as myself. Thank you, Rick!!

https://weblog.west-wind.com/posts/2016/Jun/06/Publishing-and-Running-ASPNET-Core-Applications-with-IIS#'Running'IIS

like image 172
user1205746 Avatar answered Dec 21 '25 23:12

user1205746



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!