Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

It was not possible to find any compatible framework version. The specified framework 'Microsoft.NETCore.App', version '2.2.0' was not found

Tags:

c#

.net-core

I had a .Net Core console app built and deployed.

The project's Platform target is x86.

Target framework is .Net Core 2.2(x86).

Although .Net Core 2.2 (x86) SDK is installed, I get following error after executing the command dotnet myapp.dll in Developer Command Prompt VS2017.

It was not possible to find any compatible framework version
The specified framework 'Microsoft.NETCore.App', version '2.2.0' was not found.
- The following versions are installed:
2.0.7 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
2.0.9 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
2.1.5 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

The .Net Core 2.2(x86) SDK was installed under path "C:\Program Files (x86)\dotnet\shared", and System Environment Variables contains "C:\Program Files (x86)\dotnet\".

Any suggestion? Thanks!

~~~Update1

Following are part of .csproj info, sorry can't show whole thing.

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.2</TargetFramework>
    <Platforms>AnyCPU;x86;x64</Platforms>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
    <PlatformTarget>x86</PlatformTarget>
    <Prefer32Bit>true</Prefer32Bit>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <PlatformTarget>x64</PlatformTarget>
    <Prefer32Bit>true</Prefer32Bit>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
    <PlatformTarget>x86</PlatformTarget>
  </PropertyGroup>
like image 564
wltz Avatar asked Sep 06 '25 18:09

wltz


1 Answers

After searching through Microsoft's documentations, I noticed that I was missing an additional required Nugget package.

The documentation stated:

Before you can use the tools on a specific project, you'll need to add the Microsoft.EntityFrameworkCore.Design package to it.

This is what I did by adding the package

$ dotnet add package Microsoft.EntityFrameworkCore.Design

like image 79
Omar El Hussein Avatar answered Sep 10 '25 04:09

Omar El Hussein