.NET Core Hosting Runtime and SDK on Windows Server 2012 for running dotnet commands - asp.net-core

Running ASP.NET Core websites under IIS on a Windows Server 2012 where we installed the .NET Core 2.2.7 Hosting Runtime installer.
With Azure Release pipline we want to run our migrations using commands but we got a message saying:
Did you mean to run dotnet SDK commands? Please install dotnet SDK from: https://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
So basically we also need to install the .NET Core SDK, but will this work when having the Hosting runtime installed? Can we drop the hosting runtime and only install the SDK? I guess not because I thoughed the SDK is for developing.
How to perform dotnet operations on staging and production environments?
UPDATE
To be more clearly about I am asking, I want to run my Entity Framework Migrations on the environment after the deploy process. So basically running the command dotnet ef database update -v after pushing the files on the staging and production enviroment. So not in the Azure container but on the real destination webserver.

Related

HTTP Error 500.31 - ANCM Failed to Find Native Dependencies

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.

How to deploy dotnet core code on Linux machine without stop/start the servcie?

We have deployed a project which is dotnet core 2.2 to Linux server. When we deploy the code, we have to manually stop/start the service.
Is it possible to deploy the latest code without stop/start service using dotnet commands?

Restart needed after installing .NET Core Runtime and SDK?

We're about to deploy a netcore 2.0 application on production, but we need to install .NET Core Runtime and SDK first. Is a restart needed for the installation to take effect? Since it's production, we don't want that to happen.
We installed the following from here
x64 Installer (SDK)
x64 Installer (Runtime)
Windows Server Hosting (Runtime)
There was no need to restart the machine and nothing blew up (:
If you are creating a Windows Service using the .NET Core SDK (Microsoft.Extensions.Hosting.WindowsServices) and deploying it in the target machine you need a restart (atleast a log off depending on the application you are running). Here is what happens.
Install .NET Core Runtime
Deploy a windows service.
You will notice that the command line in the windows service will be "dotnet "
Start the service. It will fail because it cannot find the tool "dotnet".
This is because the service control manager (services.msc) is not aware of the dotnet command being added to the path. So you can either do a log off (or)restart to make sure things work.
You could just install Windows Server Hosting Bundle without SDK on your production machine (actually it should be).
But then you'll get 502.3 error, and you could add a element as follows into {YourProject}.csproj file, and then it'll work like a charm.
<PropertyGroup>
<PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
</PropertyGroup>
Ref: https://github.com/dotnet/coreclr/issues/13542
With respect to either:
.NET 6.0 Desktop Runtime (v6.0.2) - Windows x64 Installer Link
.NET 6.0 Runtime (v6.0.2) - Windows x64 Installer Link
... a reboot is not required.
I didn't have time to test:
ASP.NET Core 6.0 Runtime (v6.0.2) - Windows Hosting Bundle Installer Link
ASP.NET Core 6.0 Runtime (v6.0.2) - Windows x64 Installer Link
... but agree with #MuqeetKhan that you should ideally have both a dev && testing lower environment before performing a production install. (Though, I also understand with smaller co's, that due to constraints & battles lost; this may not be possible.)

dotnet core version number and corresponding build

On dev server when i check dotnet core version number it shows
C:\>dotnet --version
Microsoft .NET Core Shared Framework Host
Version : 1.1.0
Build : 928f77c4bc3f49d892459992fb6e1d5542cb5e86
How do i find corresponding build/installation files on dotnet core download page
I am setting up a new server and i need to make sure i have the same version of dotnet core runtime installed as dev.
Also on the same note where can i find prevision vresions on Windows Server Hosting for dotnet core
Screenshot
Just search for the tags or releases inside the .Net Core Github repo or on the archives site on Microsoft.
But you should really upgrade to a version that is not end of life.

TFS release management, .net core rc2 deployment to on-premise servers

New to Visual Studio Team Services, previously Visual Studio Online
I have a couple .net core rc2 apps.
Example 1: Solution contains 1 .net core MVC app, 1 Web Api app, Multiple dependent assemblies.
I've got 3 on-premise servers (Dev, QA, Staging)
My dev server contains the build agent. My confusion is on how to best deploy these apps to my on-premise servers and finally to my production server on azure.
Do I generate webdeploy packages? If so, where and with what? In my build definition or release definition (on tfs)?
What would be the proper way to do the deployment part of these .net core rc2 apps and (using what, and in what order) is what im trying to figure out.
To my understanding so far, I believe on check in (CI build), I build/deploy to all 3 environments (dev, qa, staging). With dev and qa being automatic. Staging being either automatic or approved (authorized), depending on QA results. Finally production, being manual. I understand this is not set in stone, and certain things can be done differently, but does it sound right?
Oh, and all my servers are windows server 2012 r2
You can use build definition to build your project and generate the deployment packages and then use release definition to deploy the packages. In the release definition, you can add three environment to deploy to Dev, QA & Staging. For how to build and deploy Asp.Net Core app, please refer to this link for details: Build and deploy your ASP.NET Core RC2 app to Azure.