ayar
ayar

Reputation: 143

Run ASP.NET application on Linux

I am trying to run an application made in .NET Framework 4.5 (Windows) in a Linux environment (Centos7).

I have tried with mono and xsp4 but I have the following doubts:

regards

Upvotes: 2

Views: 3609

Answers (1)

BradleyDotNET
BradleyDotNET

Reputation: 61339

Applications written for the standard .NET framework will not run in Linux; you can try to run them in Mono but it has a number of restrictions in terms of what it supports. If you want to guarantee support it would probably be better to compile your app with Monodevelop so it will compile against that runtime. It is also the "old" way of doing this.

What you should be doing is targeting .NET Core; which is designed to run on other operating systems (including a number of Linux distributions). When you do that you would add a runtime identifier for your distro and publish to it; generating binaries that will run with the dotnet command on that platform.

Note that when using .NET Core in production you need to set up a reverse proxy to a "production ready" webserver like IIS, Apache, or Nginx as those are hardened against attacks the Kestrel server still is not.

Upvotes: 4

Related Questions