Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do .NET Core apps require the .NET runtime installed on the target machine?

In this video, Scott Hanselman interviews a guy from the ASP.NET team. He says that one of the goals of ASP.NET 5, on top of .NET Core, is that the apps won't depend on the .NET Framework and GAC assemblies on the hosting server. Instead, .NET Core libraries will be released via NuGet packages and apps will be deployed with their dependencies.

One of the reasons for this is so Microsoft can quickly release a bug fix or new feature, and we don't have to wait until the new version (of the full framework) is installed on our hosting environment.

My question is:

Are the apps built on .NET Core really independent of the version of .NET installed on the target machine, and can they run even without the .NET Framework installed?

like image 283
Liero Avatar asked Aug 16 '15 16:08

Liero


People also ask

Does .NET Core need runtime?

Only the . NET Core Runtime is required to run an application and provides information about the install. To develop, build and publish an application will require an SDK.

Does .NET Core need to be installed on server?

They are designed to allow them to be installed side-by-side. However you do need to install the . NET Core runtime onto the server to allow the code to be run because the OS has native dependencies that need to be present. See this link for more information.

How does .NET Core runtime work?

NET Core runs on Windows, macOS, and Linux operating systems. There are different runtime for each operating system that executes the code and generates the same output. Consistent across Architectures: Execute the code with the same behavior in different instruction set architectures, including x64, x86, and ARM.

Which application can be installed and run on any platform without Dotnet core runtime?

Self-contained Application Self-contained applications are applications which include . NET Core runtime when we publish it. It can run on a machine which does not have . NET Core runtime installed.


1 Answers

Yes, the framework you use in your application is completely independent of the .NET Framework installed on the target server, because the Core .NET Framework is referenced via NuGet packages and can be bundled up for deployment via the DNX Utility, specifically of interest to you will be the dnu publish command.

Here is an excerpt, describing what dnu publish does:


Publish (dnu publish)

The publish command will package your application into a self-contained directory that can be launched. It will create the following directory structure:

  • output/
  • output/packages
  • output/appName
  • output/commandName.cmd

The packages directory contains all the packages your application needs to run.

The appName directory will contain all of your applications code, if you have project references they will appear as their own directory with code at this level as well.


So the .NET Core will exist in the output/packages directory and will not need to be installed on the target server.

like image 111
Karl Anderson Avatar answered Oct 26 '22 22:10

Karl Anderson