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

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.

Related

AspNetCoreModule Not Appearing in Modules list for website in IIS, even after installing Windows Hosting Bundle

I am trying to run a .Net Core 2.1 Website through IIS. I had to reinstall IIS recently and was getting the error when navigating to my website:
Handler "aspNetCore" has a bad module "AspNetCoreModule" in its module
list
So I downloaded and installed the Windows Hosting Bundle for the relevant version of .Net Core from here https://dotnet.microsoft.com/download/dotnet/2.1
I then restarted IIS but I am getting the same error.
I noticed in the IIS Modules page for the ASP.Net Core Website I am trying to run, there is still no AspNetCoreModule listed. I take it it should be appearing here after installation of the bundle?
Any ideas what could prevent the installer adding this module?
This error can occur if the AspNetCoreModule is not installed properly in IIS on the computer that is running the Microsoft Dynamics NAV Web Server components. To resolve this issue, open Programs and Features in Control Panel and check whether Microsoft .NET Core Windows Server Hosting is installed. If it is installed, repair it from Programs and Features, by selecting it, choosing Change, and then choosing Repair.
I also noticed that the SDK downloaded in the link you provided has x64 and x86. please check if you had downloaded the correct version.

HTTP Error 502.5 - Process Failure in .Net core 1.1

It was not possible to find any compatible framework version
The specified framework 'Microsoft.NETCore.App', version '1.1.2' was not found.
Check application dependencies and target a framework version installed at:
Alternatively, install the framework version '1.1.2'.
I installed Windows (Server Hosting) installer and Runtime Installer 64-bit but still facing this issue
I tired all possible solutions but nothing is working for me
please help me!
Thank You
Try running your website from the command line with command below:
dotnet YourWebApp.dll
This way you'll be able to see any errors which may be preventing your website from starting. You can then follow the erros shown and look for their specific fixes.

ASP.NET Core with .NET 4.6.2 and VS 2017 RC

Using Visual Studio 2017 (RC), I am trying to setup a project that uses ASP.NET Core, but with the .NET 4.6.2 library.
This is a supported configuration:
Visual Studio will then create a default project; but it doesn't run:
This is without changing a single line in the project: the VC2017 template just does not work.
I tried the following:
- Different versions of the .NET framework
- x86, x64, AnyCPU
- Clear the NuGet cache
- 'Repair' options on Visual Studio's installer.
My understanding is that the error is a x86/x64 mismatch. But since I didn't change a single file from the template, there has to be something else wrong.
Installing ASP.NET Core on .NET Core works perfectly, so the problem is limited to using the regular .NET framework.
Any ideas?
I have the same problem too. But I just found the solution.
In ".csproj" I change some things:
<PropertyGroup>
<TargetFramework>net462</TargetFramework>
<!--<RuntimeIdentifier>win7-x86</RuntimeIdentifier>-->
<RuntimeIdentifier>win10-x64</RuntimeIdentifier></PropertyGroup>
And I enable the 64-bit version of IIS Express.
I had problems like these when I restored stuff to a new laptop.
I mindlessly I copied files from my old profile directory to a directory with the same name, but that isn’t a profile directory on the new machine.
A part of this process involved a cloud backup service that my wife bought for me but that I never actually set up right. That also copied files to new locations without my paying attention to what was happening.
I still don’t know (yet) exactly how the machine keeps track of which versions of frameworks and tools to use in the various application directories, but I can report what I did that finally allowed me to create new .NET Core apps on the new machine.
I deleted everything in this directory that was older than today.
%USERPROFILE%.nuget\packages
Again, pretty mindless. I don’t know, (yet) if all that was necessary. Maybe just deleting one or two of the files/directories would have worked. Regardless, I was very happy to see that I could create and develop .NET Core apps on my new machine.

'Forms' is not a member of 'Windows'

I tried to change the Target Framework on my app recently from .NET Framework 4.5 to 4.5.2, but if I do I get the following error when trying to build: "'Forms' is not a member of 'Windows'" (that is, System.Windows.Forms). Changing to 4.5.1 works normally. I'm using Visual Studio 2013 Ultimate.
I had this error when changing to 4.5.2.
In my case the error was related to a MessageBox ... I replaced: "Windows.Forms.DialogResult.Yes" (which caused the same error message) with "System.Windows.Forms.DialogResult.Yes" which did the trick.
I had the same problem, me too with Windows.Forms.DialogResult enumeration values.
The project automatically imports System and System.Windows.Forms namespaces and worked fine up to 4.5.1.
In 4.5.2 I had to remove Windows.Forms. and just leave DialogResult.Ok (or whatever else) in my code, it seems to be a problem with namespaces resolution.
Make sure that you add System in front of the Windows.Form.
I ran into this with an application still targeted to .NET 4.0, where it failed on one (new) build server, but ran on my older ones.
I narrowed it down to the .NET 4.0 Targeting Pack only being installed on the old build servers. Targeting pack is included in Visual Studio, or the Windows 7.1 SDK. It is for some reason not distributed separately, and with support ending for .NET 4, 4.5 and 4.5.1, I don't suspect this is likely to change. Because my older servers have been around a couple years, they've gone through in-place upgrades and so had the targeting pack already.
When you install Windows 7.1 SDK on Server 2012R2, it complains something to the effect of "A pre-release version of .NET 4 is installed, please install the RTM version". As far as I can tell, it's simply because a newer version) is installed -- Server 2012R2 comes with 4.5.1. I tried to uninstall all newer versions, but was unable to get the SDK to install the targeting pack.
So to install:
Download the Windows 7.1 SDK ISO image
Unzip it
Run Setup\MTPack\netfx_dtp.msi EXTUI=1
You should now have a %programfiles(x86)%\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\ folder with the 4.0 stuff.
(EXTUI=1 bypasses the restriction that it can't be installed separately).
This allowed me to compile projects still targeting 4.0 (or re-build old revisions/branches that were targeting it at the time).

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.