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?
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.
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.
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.
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.
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:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With