0
votes

After moving the application I get this error. I have downloaded and installed SDK 3.1.302 and runtime 3.1.6 but I get this error:

HTTP Error 500.31 - ANCM Failed to Find Native Dependencies

Common solutions to this issue: The specified version of Microsoft.NetCore.App or Microsoft.AspNetCore.App was not found. Specific error detected by ANCM: It was not possible to find any compatible framework version The framework 'Microsoft.AspNetCore.App', version '2.2.0' was not found. - The following frameworks were found: 2.1.20 at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] 3.1.6 at [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] You can resolve the problem by installing the specified framework and/or SDK. The specified framework can be found at: - https://aka.ms/dotnet-core-applaunch?framework=Microsoft.AspNetCore.App&framework_version=2.2.0&arch=x64&rid=win10-x64

On the SDK .net core download page it says 2.2 is no longer supported and so I downloaded. 3.1.302 as recommended. However, I think I need to find somewhere in my VS 2019 for that solution and change it to 3.1.6 runtime from 2.2 but I have no idea where that would be.

I looked on the web for a solution but could not find one. I found a mention of removing this environment variable but that didn't work.

 <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />

Where is my app referencing .net core 2.2? It worked so well on Windows 7 Visual Studio 2017 that I moved it from.

2

2 Answers

0
votes

Under project csproj file configuration you have something like
<RuntimeFrameworkVersion>2.2</RuntimeFrameworkVersion>
or <TargetFramework>netcoreapp2.2</TargetFramework>
or <PackageReference Include="Microsoft.AspNetCore.All" Version="2.2" />?

And 2.2 is no longer supported you need back to 2.1 or 3.x. I suggest you to upgrade project to latest version if is it possible.

or you can still download the SDK 2.2 from archive.

https://dotnet.microsoft.com/download/dotnet-core

0
votes

Installing .Net Core 3.1 does not install the older runtimes by default. You will need to install 2.2, or when you publish your program, publish it as "Self-contained" which should include everything needed to run it.

While 2.2 has been EOLed, you can still run your .net core 2.2 program. You can download the last 2.2 runtime here: https://dotnet.microsoft.com/download/dotnet-core/2.2

You will likely want the Windows Hosting Bundle.

Install that, and once it's complete, you can check your runtime version from powershell with dotnet --list-runtimes

You should see a list of installed runtimes come up. You will want to see something like: Microsoft.NETCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

With that you should be able to run the application.

That being said, I would also recommend updating to 3.1 as soon as possible.