Linux distributions support ASP.NET applications. In this article, we will guide you to install the .NET application on the Ubuntu distribution. To run the .NET application that you have developed, you need to install the SDK package developed by Microsoft. And package manager downloads are only supported on x64 architecture. Additionally, for ARM and other architectures, you can install it with Snap package manager or manually.
What is ASP.NET?
ASP.NET holds the content that appears in the static structure separately using the ASPX structure. It uses one of the “.net” languages when designing web pages and applications. ASP.Net is a very powerful web development platform that comes with .NET Framework. It enables not only HTML-based static pages but also interactive and renewable dynamic pages. E-commerce sites, news portals, corporate applications, and forum sites, which are among the most popular web applications of today, can be designed and managed with ASP.NET.
How to run ASP .NET applications on Ubuntu?
Step 1: Download .NET SDK on Ubuntu
First, download the SDK package. To do this, paste the command on the terminal screen and complete the download:
wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
Step 2: APT Package Update
Now, update the APT package manager by using the following command:
sudo apt update
Step 3: Install .NET SDK
For the application to work properly, you need to know which .NET version is and install that version. In this article, assuming that your application is developed with ASP.NET 5.0 version, this version will be installed:
sudo apt search dotnet-sdk
sudo apt install dotnet-sdk-5.0
Well done. You have successfully installed the .NET SDK package on your Linux distribution. Let’s run the project.
Step 4: Make your application compatible with Linux
Search the project’s folder via the terminal screen and run the following command. You can give any name you want.
dotnet publish -c Release -o out
Step 5: Run your application
Check the created project name in the folder and then run your application using the following command. The Project.WebUI that appears in the folder is your project’s file (“Project” is your project’s name).
dotnet out/Project.WebUI.dll
Perfect! You have run your web application now. You can check your web application at http://localhost:5000.