I am setting up a Ubuntu machine to deploy a Asp.Net MVC Core app according to the instructions here. In it, it asks for the .NET Core SDK to be installed.
If my server is meant to just run the web application, is it necessary to install the SDK?
Also, if my app is developed in .NET Core 3.0 in Visual Studio, is it ok to have it in a .NET Core 3.1 runtime?
Runtime will be enough to run deployed application https://dotnet.microsoft.com/download/dotnet-core/3.1
In fact you don't even have to do that. Because you can also Publish self-contained package
https://learn.microsoft.com/pl-pl/dotnet/core/deploying/#publish-self-contained
Which will carry all resources needed for runnint your applicaiton on target OS
v3.1 runtime should support your application built in v3.0
From docs;
Install the SDK (which includes the runtime) if you want to develop
.NET Core apps. Or, if you only need to run apps, install the runtime.
If you're installing the runtime, we suggest you install the ASP.NET
Core runtime, as it includes both .NET Core and ASP.NET Core runtimes.
So you do not have to install SDK if you only need to run apps.
You need to install same runtime version as your project (SDK) version
Related
I upgraded an existing application from asp.net core web API 2.0 to 3.1. When I run the application locally, application runs fine without any errors, but when I deployed the application to the same server where the 2.0 application was running, I got an error saying "ANCM failed to find Native dependencies".
Below is the screen shot:
From the provided link:
https://dotnet.microsoft.com/download/dotnet-core/3.1
I was able to find out that I need to install .net core 3.1. I am not sure if I need to install on my server:
ASP.NET Core Runtime 3.1.3
OR
SDK 3.1.201
I already have few 2.1 applications running on the server so I don't want the older applications to stop working if I upgrade to 3.1 . I have IIS installed on the server. Its a Microsoft windows NT version 6.2 DataCenter edition terminal server and my application that I am trying to deploy is .net core 3.1
I just wanted to know whether I should install ASP.NET Core Runtime 3.1.3 or SDK 3.1.201
and installing any of these on the server wont affect the applications that are running on 2.0 .net core framwork.
any help will be apprecaited.
Each .NET Core will define which version it uses and will use that SDK or runtime. Installing another SDK or runtime will not impact previously installed versions.
If your just hosting and not doing any development on the server then you only need to install the runtime. If any development will be taking place you will need the SDK.
My website, hosted at DigitalOcean, is currently running on .net core 2.0, but I want to upgrade to .net core 2.2.5
As I understand it I have two options:
1.) Keep .net core 2.0 and install .net core 2.2.5 alongside.
2.) Uninstall .net core 2.0 using the script here. And then install .net Core 2.2.5
If I do option 1.) I understand this will affect diskspace used on droplet, but what about website performance, are there any performance issues or other issues doing this option?
You can install multiple dotnet core runtimes side by side. This will not affect performance of your app. As a default, your app will use the runtime with the highest version number.
I want my ASP.NET Core Web API to run as a self-contained exe within the .NET framework and not .NET Core Framework. Is that possible? Thanks!
EDIT:
If I add "net451": {} to my frameworks section in project.json,
I get the following exception:
Failed to make the following project runnable: myProject (.NETCoreApp,Version=v1.0) reason: Expected coreclr library not found in package graph. Please try running dotnet restore again.
You can't create a self-contained app which targets .NET Framework >=4.5, because the full .NET Framework isn't modular and its not possible to have more than one version of it installed. Newer versions basically always replace the previous one.
Self-contained apps were one main motivation for .NET Core (together with portability)
You ALWAYS have to install .NET >=4.5 before your app can run. self-contained apps only work with .NET Core because .NET core libraries can be pulled through nuget package.
For .NET 4.6 you can only create portable apps, which is the default mode.
Can I define coreclr (asp.net core) target runtime for portable app that differ from development platform? Say build app under windows for Ubuntu? Thought that projects are platform independent so that only .net runtime is specific one.
This is explained in the Types of portability in .NET Core article in the .Net Core documentation.
In short, by default, .Net Core applications are portable, which means that you can for example run dotnet publish on Windows and then run that application using dotnet yourapp.dll on any supported platform, including Ubuntu.
Could you kindly advise if we need to have .NetFrameWork Installed on Client's computer, if we make setup by using ClickOnce technology?
Thanks
ClickOnce is a part of .NET Framework 2.0 and later, so yes, you need at least .NET Framework 2.0 installed on a machine in order to use it. See also here:
The installation engine for ClickOnce
is in the .NET Frameworks v2.0... as a
result, the .NET Frameworks needs to
be on the machine in order to install
a ClickOnce deployed application. The
Generic Bootstrapper (setup.exe) will
install the .NET Frameworks v2.0
before launching the ClickOnce
application deployment.