user14853506
user14853506

Reputation:

switch asp.net core run os from windows to linux

I have built an ASP.NET Core web app using Visual Studio community (NOTE: on my local Windows machine) that I am satisfied with. I now want to deploy it to the web. Only, my deploy environment is a Linux machine, not a windows machine. In the \bin\Debug\net5.0 and \bin\Release\net5.0 there are several .exe and .dll files that Linux can not run. How do I switch the run environment from windows to linux? Am I missing something here?

Upvotes: 1

Views: 1176

Answers (1)

Brando Zhang
Brando Zhang

Reputation: 28192

As far as I know, if you want to run the asp.net core application on the linux. You should firstly make sure you have set the publish environment to the protable or linux.

Then you should make sure you have installed the .net core runtime for linux on that linux machine. Then you could use apache or nginx as the reverse proxy server to rub the application.

More details about how to host asp.net core application on Nginx, you could refer to this article.

More details about how to host asp.net core application on apache , you could refer to this article.

More details about how to set the target environment , you could refer to below image:

enter image description here

Upvotes: 1

Related Questions