How does C # run on other platforms?

4

As a complement to this question , run C # in a where the .NET Framework is native, it is standard to run the application executable. As far as I know, C # depends on the .NET Framework to be compiled and run , and thus have all code functions running natively on your platform.

But what about Linux? I know that without .NET Core installed it will not be able to run a natively .NET application, but this requires its installation on the machine.

When I run an application that was written in C # on a mobile phone, I do not install any dependencies, the application runs natively and stable, and without the .NET Framework. How does this happen?

Is there a .NET Framework sub-platform on all .NET Core compatible devices? Or does .NET Core fit the platforms? If so, how does he do it? Is there any significant performance loss?

    
asked by anonymous 17.07.2018 / 19:36

2 answers

5
  

But what about Linux? I know that without .NET Core installed it will not be able to run a natively .NET application, but this requires its installation on the machine.

This is not true. .NET Framework is not the same as the .NET Framework. It does not need to be installed. Actually can not even be installed. It is an SDK that you use in your development environment and a library that goes along with your application. You can use part of the SDK to share the environment if you want.

  

When I run an application that was written in C # on a mobile phone, I do not install any dependencies, the application runs natively and stable, and without the .NET Framework. How does this happen?

This is another case. It uses the Mono that has the ability to generate native code directly, without needing a JITter, even by the platform's own (iOS) requirement. It generates the executable just as C or C ++ generates.

In fact there is .NET Native that also does this, but is only available for some application types.

They use a normal compiler that generates a native code. This is normal, the strange thing is what the .NET Framework does.

  

Is there a .NET Framework sub-platform on all .NET Core compatible devices? Or does .NET Core fit the platforms? If so, how does he do it? Is there any significant performance loss?

No, this does not make any sense. The .NET Framework is part of the Windows operating system, so it tends to be underused, since today there is demand for something more standard.

.NET Core has far superior performance in several places, .NET Native even more. The Mono, and therefore Xamarin performs worse on some points, but is improving, but when used with native code it may be faster than the .NET Framework.

The .NET Framework will tend to be used as a legacy from the coming year when what is missing for Windows will be available to it.

I would love for everything to be native, but it has technical limitations that some applications can not accept. There is less control and less capacity for reflection, which prevents a number of libraries from working. In some cases it may require duplication of content, which is not desirable.

The graph of the other answer is obsolete (actually the answer does not answer what was asked and speaks .NET Standard that was not asked).

    
24.07.2018 / 15:35
2

First keep in mind the image below:

.NETFRAMERWORK,.NETCORE,andXAMARINallconformto.NETSTANDARD.

.NETSTANDARDisaspecification,notaframework.".NET Standard is an interface, a kind of contract that defines the list of APIs that that particular version of .NET should support."

If you inspect the repository in github you will see a set of empty methods and / or functions that return null. See the System.Console.WriteLine , for example:

public static void WriteLine(string value) { }

Anydevelopercancreatetheirownframeworkforaspecificplatform(example.NETCOREforZ80MSX)aslongastheyrespectthe.NETStandard.

TodayyouhaveXAMARIN(iOS,OSXandAndroid),.NETCORE(Windows,LinuxandMacOS)and.NETFRAMEWORK(Windows).Notethatsome.NETFrameworkassembliesarenotpartofStandard,forexampleSystem.Windows.Forms,andwillprobablyneverbepartofit.

Thatis,a.NETStandardFrameworkisallowedtoaddassembliesthatarenotpartof.NETStandard,butitisnotallowedtomodifyorremoveAssembliesthatarealreadythere.

TolearnmoreIsuggesttheMVParticleEduardoPires: .NET Standard - You need to know!

    
17.07.2018 / 20:23