If you like DNray Forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...

 

Multiplatform ASP.NET Core: Can It Work on Linux?

Started by Midwiloom, Feb 28, 2023, 03:23 AM

Previous topic - Next topic

MidwiloomTopic starter

The ubiquity of the claim that ASP.NET Core is a cross-platform technology that is compatible with Linux is indisputable.



Have you ever attempted to locate hosting services specifically for version 2.0? Unfortunately, my quest has been fruitless so far. I'm curious to know whether anyone from the community has come across such hosting services and tried them out. What were the outcomes of your experience? If hosting hasn't been your priority, perhaps you have experimented with operating your ASP.NET Core applications on a Linux platform?
In this case, what sort of results have you attained? To what degree has the platform remained steady? Furthermore, what prospects do you envisage concerning these developments?
  •  


kompany

There are numerous hosting services, such as Microsoft Azure and Amazon AWS, among others.

During my holiday break, I tested the functionality of AppHarbor, specifically its support for Framework 2.0 and ASP.NET Core overall. Although it was compatible and functioning, their free limits are limited (i.e., SQL database only allows for 20 MB) and paid plans come at unreasonable prices. As a result, I am exploring other options such as AspHostPortal or Host on tariff.

Although we have not yet implemented this technology in any actual projects, I believe that it is stable and mature enough to do so this year. However, given the conservatism of the corporate sector, this may take some time.

I have been using masterhost to host several websites for many years, primarily consisting of PHP projects. Recently, I attempted to run .NET Core on their Windows-tariff with IIS8 and found the experience to be quite favorable. While testing several demo applications (a typical MVC app from Microsoft and a simple WinAPI app), I did not encounter any major issues, which remained true even as I began working on my first project.
  •  

Bubunt

Perhaps I'm missing something, but all you need is a server! It worked seamlessly, without any issues when running under Linux. If you're interested in experimenting with placing a service or website under MVC, I'd recommend utilizing a cloud service; Azure is my personal preference.

However, be advised that you may run into issues if Linux itself was not functioning properly beforehand.

I've tested .NET Core prior to its official release and have yet to encounter any problems during the launch process. Even to this day, I still haven't had any issues.
  •  

seocyrusjpr

As I was looking for hosting options for ASP.NET sites, I prioritized specific parameters. Firstly, compatibility was crucial. I immediately disregarded any hosting options with Linux settings that attempted to impersonate ASP.NET site hosting. For the full benefits of .NET Framework, Windows Server is a must-have.

Secondly, optimized servers were essential. One must prioritize the latest versions of .NET, Windows Server, MSSQL, and IIS for modern infrastructure and optimal performance.

Thirdly, I considered the price-to-quality ratio. ASP.NET hosting plans are typically costly. Therefore, if a hosting service wanted to charge me extra, it would be better if they provided additional useful functions such as automatic data backup and improved protection.

Support for databases and additional modules was also a critical factor. While MSSQL support is necessary, it is useful to have support for other databases like MySQL, MariaDB, and PostgreSQL, as well as mandatory modules such as ODBC. Other modules like Access, MVC, and Silverlight may also be necessary.

Lastly, having expert knowledge is crucial since technological support for Windows Server isn't as extensive as Linux. In case something goes wrong, timely help from Windows experts is essential.

Kamatera offers dedicated cloud hosting for ASP.NET sites and provides flexible cloud servers suitable for dedicated hosting environments. They offer several options for setting up a cloud server, including selecting data center location, operating system, and control panel. However, subscriptions come with limited disk space and traffic, and additional charges apply for incoming traffic exceeding outgoing traffic.

Kamatera is a great option for websites or applications catering to an audience primarily in Israel, Egypt, or nearby countries since they have a large network of data centers in the Middle East. Furthermore, Kamatera offers extended daily backup, licenses for third-party software at more affordable prices, and four types of CPUs to choose from. One can also add computing power, RAM, and disk space as required.
  •  

pmyualxlg

Firstly, you're correct that ASP.NET Core is a cross-platform framework and can be run on many different platforms including Linux, macOS, and Windows. It's one of the advantages of using .NET Core and certainly one of the reasons for its increasing popularity.

Given the cross-platform nature of .NET Core, you should be able to host an ASP.NET Core 2.0 application on pretty much any server that supports .NET Core, including many Linux-based servers.

Hosting for .NET Core

For ASP.NET Core hosting on Linux, you may want to consider companies that provide plain virtual private server (or VPS) hosting, like:

AWS and Azure: Both are high-profile cloud service providers offering extensive support for .NET applications and Linux environments.
DigitalOcean: Quite popular for its relatively simple platform and pricing structure.
Linode: Also famous for their VPS hosting.
Vultr: Offers a wide range of support for different platforms.
In terms of managed hosting, A2 Hosting and Hostinger provide plans for .NET core applications as well, although you might want to verify the supported versions.

Setting up a Linux Server for .NET Core

Bear in mind, hosting .NET Core on Linux often means you'll need to set up the server environment yourself. This includes installing the .NET Core runtime or SDK on the server, configuring the server to run your application (for example, setting up nginx or Apache as a reverse proxy), and setting up any other services your application depends on.

Stability of .NET Core on Linux

As for stability, ASP.NET Core has generally proven to be quite stable on Linux. As far as I know, there have been no significant issues or limitations compared to running on Windows. In fact, some developers report improved performance on Linux.

Future Prospects

Microsoft has always been keen on improving cross-platform capabilities and Linux support for .NET Core. With the release of .NET 5 and upcoming .NET 6 (due to unify the .NET platform once again), the trend looks set to continue. So we can expect better integration and improved performance in the future.


Here's more information on running ASP.NET Core on Linux:

Performance

While this can vary based on specific server configurations and applications, many developers have reported improved performance when running .NET Core applications on Linux compared to Windows. This might be due to overhead in the Windows OS or simply due to optimizations that the .NET Core runtime can make on Linux. However, your mileage may vary because many factors can impact performance, including the specific hardware and network conditions.

Tooling and Development

One of the big benefits of .NET Core being cross-platform is that you can develop and test your application on Windows or Mac, and then deploy to a Linux server. Visual Studio and VS Code offer excellent development environments for .NET Core, and they are also cross-platform.

If you're used to Windows but need to work with Linux servers, consider using Windows Subsystem for Linux (WSL). This provides a Linux environment right within Windows and can be an excellent way to develop and test your application. You can install the .NET Core SDK, run your application, and even run a local database if needed.

Docker and Containerization

Another trend in ASP.NET Core development is deploying applications in containers using Docker. Since Docker can run on Linux, Windows, or Mac, this can be an excellent way to ensure that your application runs the same way in development as it does in production. In addition, Docker can abstract away some of the differences between running your application on Windows and Linux.

Scalability

Linux servers are often a good choice if you need to scale your application, as Linux servers can often be less expensive than comparable Windows servers. Cloud providers like AWS, Google Cloud, and Microsoft's own Azure service all offer Linux servers, often at lower costs than Windows servers. Autoscaling for Linux hosts is also a feature provided by these platforms.


Let's delve deeper into the areas of optimizing .NET Core applications for Linux servers, and potential pitfalls to avoid.

Optimizations for Linux:

Threading: In some scenarios, .NET Core applications on Linux can take advantage of the more efficient thread handling in the Linux kernel for increased performance.

Disk operations: Linux systems often offer more straightforward and faster disk operations, which can benefit IO-heavy applications.

Networking: Many find that Linux offers more configurable and efficient networking stacks than other operating systems, which can be beneficial for applications heavily relying on network traffic.

Pitfalls to Avoid:

Case Sensitivity: Unlike Windows, Linux is case-sensitive. This trait can turn into a problem when your application expects certain files in a specific case that doesn't match the case on the filesystem.

Path Separator: In Windows, the backslash(\) is used as a path separator, while Linux uses a forward slash(/). If not addressed, this can cause path-related issues.

Permissions: Linux has unique user and group permission settings that don't exist in the same way on Windows. Because of that, you might face permission-related issues during file operations, for instance.

Remember that the core idea behind .NET Core being cross-platform is to allow developers to write their code once and run it where it makes the most sense. It depends on the developers' skills, the costs, and the kind of infrastructure at their disposal. Migrating to a Linux server could mean a learning curve ahead, or possibly using new tooling or updating old codebases, but the long-term gains might make it worth the effort.

You also asked about future developments. Now, .NET Core projects would migrate to .NET 5.0 and then to .NET 6.0 as Microsoft proceeds with their one .NET vision. .NET 6.0, planned as an LTS (Long Term Support) release, will offer even more performance enhancements, improved APIs, and better tooling for developers. This ongoing evolution continues to expand the possibilities of building cross-platform applications.

Finally, the .NET community is robust and constantly growing, always pushing the capabilities of the platform, whether it's on Windows, Linux, or any other compatible system. Developers can look forward to a vigorous ecosystem that is evolving and expanding its capabilities.
  •  

soranker

The notion that ASP.NET Core 2.0 is a cross-platform technology is a myth perpetuated by Microsoft's marketing machine. I've scoured the web for hosting services catering to this version, but they're nowhere to be found.

When I did manage to deploy my application on a Linux platform, I was shocked by the number of compatibility issues and performance problems I encountered. It's clear that ASP.NET Core 2.0 is still a Windows-centric technology, and Linux users are left to struggle with subpar performance.
  •  


If you like DNray forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...