3
  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?
Servy
  • 202,030
  • 26
  • 332
  • 449
Ljgazzano
  • 91
  • 1
  • 7
  • 3
    Get started from https://learn.microsoft.com/en-us/dotnet/core/ Self contained deployment section should give you the answers. – Lex Li Nov 22 '17 at 14:19
  • There's an experimental build of .NET Core for Android on GitHub at https://github.com/qmfrederik/coredroid but we soon might not need that due to the work that Miguel de Icaza's team is doing on Xamarin. – Jamie Taylor Nov 22 '17 at 16:36

2 Answers2

2

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

Stefan Steiger
  • 78,642
  • 66
  • 377
  • 442
2

Mono and .NET Core are two separate technologies.

Mono was created by Miguel de Icaza and was originally designed to be a version of .NET Framework for Linux and MacOS. As such, it has a lot of the same APIs that .NET Framework has.

.NET Core is a cross platform implementation of .NET Standard. As such, it only has access to the APIs outlined in the .NET Standard.

Applications built using .NET Core will need the .NET Core run-time to be installed on the target machine in order to run them (depending on whether you do a self contained deploy or a framework dependant deployment). The .NET Core run-time and SDK can be obtained by heading to dot.net/core.

In the same way, applications built with Mono will require the Mono run-time to be installed on the target machine.

As Lexi-Li pointed out, I would take a look at The official documentation for .NET Core in order to learn more about the different deployment options.

Jamie Taylor
  • 1,644
  • 1
  • 18
  • 42
  • Is the goal of Mono and .NET Core similar/identical? Is it just to have a cross-platform .NET implementation? – BlueMonkMN Nov 22 '17 at 14:30
  • @BlueMonkMN: No it isn't. mono and .NET Core don't provide the same thing. Mono provides an implementation for the FULL .NET-Framework. .NET Core only provides the "Core"-version of .NET. If you need a recommendation, go with .NET-Core. – Stefan Steiger Nov 22 '17 at 14:35
  • But the goal is similar, provide a cross-platform implementation of .NET. The difference is only that .NET Core is a core subset while Mono is a full implementation from a different vendor? – BlueMonkMN Nov 22 '17 at 15:23
  • 1
    If it helps @BlueMonkMN, Mono was started back in 2004, whereas .NET Core was started in the past few years (Satya Nadella announced it back in 2014). Mono has never been that great, as it was originally created using just the documentation provided about .NET Framework, whereas .NET Core development is done completely open source by the .NET Foundation (which includes Microsoft, Google and Samsung among others) – Jamie Taylor Nov 22 '17 at 15:59