Restart needed after installing .NET Core Runtime and SDK? - asp.net-core

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.)

Related

Upgraded ASP.NET and .NET Core runtime from 3.1 to 6.0.8 but application installer still detects old runtime

I need to upgrade an application in a Windows Server 2016 machine, and in order to do so they require ASP.NET Core runtime to be v3.1.1 or higher. I have installed v6.0.8, but when running the application installer it seems to still be detecting the old version and therefore can't run the update. I checked the new version is installed using "dotnet --list-runtimes" and it shows OK. I have also checked the registry, and confirmed the new version is there. I have restarted IIS as well. But so far nothing. What could I possibly be missing? I don't have control over the application code, so I can't access the runtime json file to modify version used as I have seen in some solutions.
Any help, appreciated. Thanks.

How to build application targetting .Net 4/4.5 on CentOs

I have a lot of legacy code that builds fine on Windows with .Net 4.5
I am trying to build the same on CentOS with dotnet-sdk for automation and licensing issues.
Following the Microsoft link after installing the required packages, this command fails
$ dotnet msbuild sharpTest.sln
/usr/share/dotnet/sdk/5.0.301/Microsoft.Common.CurrentVersion.targets(1216,5): error MSB3644: The reference
assemblies for .NETFramework,Version=v4.0 were not found. To resolve this, install the Developer Pack
(SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework
Developer Packs at https://aka.ms/msbuild/developerpacks
Since I installed dotnet-sdk-5, it seems the solution fails to build. But I could not locate .Net framework 4 for CentOS
How do I resolve this ?
It's referencing .NETFramework. .NETFramework V4.0 is not xplat and therefore not available on anything else than windows. You should try to re-target your solution to net5.0 and make it independent of Windows specific dependencies.
To re-target to net5.0 try the dotnet upgrade-assistant (it's a dotnet tool). Do this on a windows machine first. To address any windows dependencies that won't work outside windows or .NetFramework see the Overview of porting from .NET Framework to .NET

asp.net core deployment persistent ErrorCode = '0x80004005 : 8000808c. on win 2012r2

I am having a persistent problem with ErrorCode = '0x80004005 : 8000808c. on win 2012r2
Deploying an updated app that uses:
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.8" />
I have installed
dotnet-runtime-2.0.7-win-x64.exe
AspNetCore.2.0.7.RuntimePackageStore_x64.exe
DotNetCore.2.0.7-WindowsHosting.exe
and rebooted the machine but the problem persists. I've deployed the same files to IIS (not IIS EXpress) on my windows 10 dev box and it works fine there.
Any ideas how to solve it?
Microsoft made it not easy to find the relevant information.
Scroll down to ".NET Core Runtime-only installation" section in release notes, and it seems that all your 2.0.7 installers were the old ones, while Microsoft almost silently refreshed all of them to include the 2.0.8 bits (what a crazy idea).
The proof is that in your screen shot there is no "ASP.NET Runtime Core Package Store 2.0.8". And you probably used Framework Dependent Deployment, instead of Self Contained Deployment, which also amplifies the issue.
I had similar error: ErrorCode = '0x80004005' : 8000808c.
I am using shared resources, and the package does not allow installation of .NET Core 2.1 SDK.
I had to change my publishing settings from Framework dependent to self-contained. That resolved the issue.
publish command:
dotnet publish --configuration Release -r win10-x64 -o "publish path" --self-contained true

Setup project: Adding .NET and Windows Installer prerequisites results in large installer

I've created my program successfully. Now, I want to publish it. I've created a Setup Project in order to make an installation file. I've added .NET 4.0 Client and Windows Installer as project prerequisites (via Setup Project Properties → Prerequisites). After that, I build my project.
This produces these files:
Setup files, .NET 4.0 Client, Windows Installer
But .NET 4.0 Client and Windows Installer make my project most biggest. So I would like to know if there is a way to make my setup file contain just the required libraries, i.e. the setup program won't install .NET on the target host?
No I don't think so - without the .net framework your are screwed here.
When you do this the .NET framework is not included in the MSI package and doesn't make the file any bigger. It is only a pre-requisite for the successful installation. So when you run the setup on the client computer if it already has the framework installed it won't do anything. If it doesn't it will ask the client to download it. You could of course remove this prerequisite but because your application is built with .NET if the client computer doesn't have the correct version installed your application won't run. So I would suggest you to leave this prerequisite in your setup project.

Why it always report .net core SDK not installed while it already here?

I am going to debug my asp.net core project in the windows server 2012R2 while the VSCode reports this.
Then I installed the .net core SDK.
However, the error above comes again.
Well, in the Programs and Features of Control Panel, it is installed already yet.
It is so strange that in the Powershell of dotnet --info.
It said that no SDKs were found.
Why it turns out to be this?
And how can I install the .net core SDK correctly?
PS: the computer is an X64 system.
I noticed that I have installed both X86/X64 Runtimes.
After I uninstalled the X86 Runtime, it works.