Skip to content
Advertisement

Understanding .Net Core and Mono

  1. When developing an application in .Net Core, the .NET dependencies and DLLs are embedded in the application? does this mean that I do NOT need to install the .Net dependencies on the client PC?
  2. If I develop a .Net Core console application for Linux, is it necessary to install Mono on the PC with Linux (client)?
  3. Are .Net core applications compatible with Android?

Advertisement

Answer

To your question:

No the dependencies are NOT embedded in the application (no static linking in .NET).
Yes, the dependencies are added as separate files, when you publish (self-contained).
If your application is a .NET-Core application, you do NOT need the .NET-Core framework installed. Neither do you need Mono.
You can do a self-contained deployment for each platform:

Windows-x86-32:

dotnet restore -r win-x86
dotnet build -r win-x86
dotnet publish -f netcoreapp2.0 -c Release -r win-x86

Windows-x86-64:

dotnet restore -r win-x64
dotnet build -r win-x64
dotnet publish -f netcoreapp2.0 -c Release -r win-x64

Linux-x86-32: NOT SUPPORTED BY .NET-Core

Linux-x86-64:

dotnet restore -r linux-x64
dotnet build -r linux-x64
dotnet publish -f netcoreapp2.0 -c Release -r linux-x64

Linux ARM (Android/ChromeOS)

dotnet restore -r linux-arm
dotnet build -r linux-arm
dotnet publish -f netcoreapp2.0 -c Release -r linux-arm

Linux-arm-64: NOT SUPPORTED BY .NET-Core

This adds all dependencies, including the .NET-Core runtime libraries. You can still run into problems if a used DLL references a native-dll (that it provides as embedded resource), but does not provide the necessary C-Runtime-libraries (e.g. when the native-dll/.so is dynamically linked – such as in SkiaSharp).

Also, .NET-Core can be run with the shared-framework, which means deployment size is smaller, but the shared-framework-version must be installed, then.

  1. Since Android is linux – and you’re not having an Android that runs on an x86-32 processor or an ARM-64 processor, .NET-Core should be Android-compatible. I never tested that premise. Might entail bugs. ARM-support is sketchy.

However, it is unclear to me what you want to do with .NET Core on Android. Since .NET does not implement any Android-UI interfaces. Xamarin-Forms might support Android-UI with .NET-Core – it certainly does with mono. You could however run a web/other-server on Android, or a console application.

See CoreDroid

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement