It was not possible to find any compatible framework version ошибка

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 FilesdotnetsharedMicrosoft.NETCore.App]
2.0.9 at [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
2.1.5 at [C:Program FilesdotnetsharedMicrosoft.NETCore.App]

The .Net Core 2.2(x86) SDK was installed under path «C:Program Files (x86)dotnetshared», 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>

asked Dec 12, 2018 at 21:39

wltz's user avatar

wltzwltz

6111 gold badge11 silver badges22 bronze badges

11

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

The documentation says:

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

answered Feb 6, 2021 at 22:52

Omar El Hussein's user avatar

4

Some months ago a Visual Studio update broke my capability of running tests. One of the issues was exactly this error. I have the x64 version of the SDK installed but VS tests runner was attempting to use the x86 version. The fix is just changing a setting inside the Test Explorer: Processor Architecture for AnyCPU Projects -> x64.

enter image description here

answered Apr 24, 2020 at 19:34

Matias Beckerle's user avatar

2

It seem to be a known issue for .Net Core installation, github.com/dotnet/core-setup/issues/4350

I have to uninstall all .Net Core packages, both x64 and x86, then reinstalled .Net Core x86 package. And that solved the problem.

answered Dec 13, 2018 at 19:57

wltz's user avatar

wltzwltz

6111 gold badge11 silver badges22 bronze badges

4

This error also happened to me, and the answer I found was very easy, =>
in my solution I had two projects and a class library, the data folder was in the API project, in the case of Migration, I set the default project to the API and I got the same error, but the answer: I just set the API project as the startup project and tried again. The issue was gone.

Have fun.
Shahab Attarnejad

Roly's user avatar

Roly

2,1192 gold badges20 silver badges33 bronze badges

answered May 16, 2022 at 11:22

Shahab Attarnejad's user avatar

Can you change .csproj to add RunCommand like below:

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

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.2</TargetFramework>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <Prefer32Bit>false</Prefer32Bit>
    <PlatformTarget>x86</PlatformTarget>
    <Optimize>false</Optimize>
    <RunCommand Condition="'$(PlatformTarget)' == 'x86'">$(MSBuildProgramFiles32)dotnetdotnet</RunCommand>
    <RunCommand Condition="'$(PlatformTarget)' == 'x64'">$(ProgramW6432)dotnetdotnet</RunCommand>
  </PropertyGroup>

</Project>

Maybe you need to add 2 line of RunCommand and update the correct path of dotnet on your laptop.

This issue happens when you are on windows 64bit and run x86 application.

answered Dec 13, 2018 at 4:02

Khai Nguyen's user avatar

Khai NguyenKhai Nguyen

9355 silver badges17 bronze badges

2

For me, I just verified that all the projects in the solution is of same Target framework version. Once that was done, the issue was fixed.

You could view the Target framework version by right clicking a project (*.csproj) and go to properties.
enter image description here

answered May 13, 2022 at 10:39

Roshith S's user avatar

When I got this error just now, it turned out that I need to run an update on Visual Studio.

Close your project window, open the Visual Studio Installer, and run the update.

answered Jun 7, 2022 at 19:58

QualitySurprise's user avatar

If you have this issue in 2022. @Khai Nguyen answer worked for me.

HelloWorld.csproj

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

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp6.0</TargetFramework>
    <ImplicitUsings>disable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>

</Project>

I changed the <TargetFramework>netcoreapp5.0</TargetFramework>

to

<TargetFramework>netcoreapp6.0</TargetFramework>

Since, 6.0 was already installed.

answered Jul 13, 2022 at 2:55

Aditya Rajgor's user avatar

  • Visual Studio 2022 v17.3.6
  • WSL with dotnet 6.0.1 (in Ubuntu) and 6.0.10 (on Windows)
  • testEnvironments.json

"Testhost process exited with error: It was not possible to find any compatible framework version"

I needed to enalbe the Remote Testing install option in the Test Options:

Remote Testing Option

answered Nov 8, 2022 at 14:14

Michael Blake's user avatar

Michael BlakeMichael Blake

2,0382 gold badges18 silver badges31 bronze badges

I was using testenvironments.json for running the unit tests, but when picking my Ubuntu distribution from the list

testenvironments.json Ubuntu

no tests are discovered. The Output window (Tests output) shows the following:

Log level is set to Informational (Default).
Connected to test environment '< Local Windows Environment >'
Test data store opened in 0,323 sec.
Connected to test environment '< Local Windows Environment >'
========== Starting test discovery ==========
========== Test discovery skipped: All test containers are up to date ==========
WSL2 environment 'Ubuntu' is starting.
Connected to test environment 'Ubuntu'
WSL2 environment 'Ubuntu' is running.
========== Starting test discovery ==========
Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Testhost process for source(s) '/mnt/c/Users/user/source/repos/Project/Project.UnitTests/bin/Debug/net6.0/Project.UnitTests.dll' exited with error: You must install or update .NET to run this application.
App: /mnt/c/Users/user/source/repos/Project/Project.UnitTests/bin/Debug/net6.0/testhost.dll
Architecture: x64
Framework: 'Microsoft.AspNetCore.App', version '6.0.0' (x64)
.NET location: /usr/local/.dotnet_install/
No frameworks were found.
Learn about framework resolution:
https://aka.ms/dotnet/app-launch-failed
To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.AspNetCore.App&framework_version=6.0.0&arch=x64&rid=ubuntu.22.04-x64
. Please check the diagnostic logs for more information.
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.ThrowOnTestHostExited(IEnumerable`1 sources, Boolean testHostExited)
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources, String runSettings)
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.DiscoverTests(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler)
========== Test discovery aborted: 0 Tests found in 704,8 ms ==========

After restarting Visual Studio, it suggested me to install the missing runtime inside WSL:

is not installed in the WSL distribution

answered Feb 10 at 11:35

Pieterjan's user avatar

PieterjanPieterjan

2,7204 gold badges26 silver badges53 bronze badges

Alright, this is such BS! Why the H can’t Microsoft get a rollout right. Roll it out right or roll it back!

Anyways — here’s what I had to do to fix this garbage.

1: I had to uninstall all of the .net Core items in the «Programs» section of the control panel.
2: I went to https://github.com/dotnet/core/blob/master/release-notes/download-archive.md and got «2.0 sdk and 2.0 runtime» and installed that.
3: I ran my migration and got the same error as above but the version it was complaining about was «2.0» — SO, I added «2.0.0» to my project and the stupid thing worked.

I hope this works for any one of you — I worked hard enough on this project just to have a «Botched Rollout» reduce it to smoke!

Oh, and another thing — my «data» project borked because the file «.EntityFrameworkCore.targets» was not cleared before it was overwritten. I had 2 ending nodes at the bottom of the file. I hope they fix THAT too.

(Sorry all, I wasted WAY too much time on this SNAFU and it didn’t have to happen.)

Перейти к контенту

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 FilesdotnetsharedMicrosoft.NETCore.App]
2.0.9 at [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
2.1.5 at [C:Program FilesdotnetsharedMicrosoft.NETCore.App]

The .Net Core 2.2(x86) SDK was installed under path «C:Program Files (x86)dotnetshared», 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>

asked Dec 12, 2018 at 21:39

wltz's user avatar

wltzwltz

5911 gold badge9 silver badges22 bronze badges

11

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

The documentation says:

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

answered Feb 6, 2021 at 22:52

Omar El Hussein's user avatar

4

Some months ago a Visual Studio update broke my capability of running tests. One of the issues was exactly this error. I have the x64 version of the SDK installed but VS tests runner was attempting to use the x86 version. The fix is just changing a setting inside the Test Explorer: Processor Architecture for AnyCPU Projects -> x64.

enter image description here

answered Apr 24, 2020 at 19:34

Matias Beckerle's user avatar

2

It seem to be a known issue for .Net Core installation, github.com/dotnet/core-setup/issues/4350

I have to uninstall all .Net Core packages, both x64 and x86, then reinstalled .Net Core x86 package. And that solved the problem.

answered Dec 13, 2018 at 19:57

wltz's user avatar

wltzwltz

5911 gold badge9 silver badges22 bronze badges

4

This error also happened to me, and the answer I found was very easy, =>
in my solution I had two projects and a class library, the data folder was in the API project, in the case of Migration, I set the default project to the API and I got the same error, but the answer: I just set the API project as the startup project and tried again. The issue was gone.

Have fun.
Shahab Attarnejad

Roly's user avatar

Roly

2,1002 gold badges19 silver badges33 bronze badges

answered May 16, 2022 at 11:22

Shahab Attarnejad's user avatar

Can you change .csproj to add RunCommand like below:

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

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.2</TargetFramework>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <Prefer32Bit>false</Prefer32Bit>
    <PlatformTarget>x86</PlatformTarget>
    <Optimize>false</Optimize>
    <RunCommand Condition="'$(PlatformTarget)' == 'x86'">$(MSBuildProgramFiles32)dotnetdotnet</RunCommand>
    <RunCommand Condition="'$(PlatformTarget)' == 'x64'">$(ProgramW6432)dotnetdotnet</RunCommand>
  </PropertyGroup>

</Project>

Maybe you need to add 2 line of RunCommand and update the correct path of dotnet on your laptop.

This issue happens when you are on windows 64bit and run x86 application.

answered Dec 13, 2018 at 4:02

Khai Nguyen's user avatar

Khai NguyenKhai Nguyen

9175 silver badges17 bronze badges

2

For me, I just verified that all the projects in the solution is of same Target framework version. Once that was done, the issue was fixed.

You could view the Target framework version by right clicking a project (*.csproj) and go to properties.
enter image description here

answered May 13, 2022 at 10:39

Roshith S's user avatar

When I got this error just now, it turned out that I need to run an update on Visual Studio.

Close your project window, open the Visual Studio Installer, and run the update.

answered Jun 7, 2022 at 19:58

QualitySurprise's user avatar

If you have this issue in 2022. @Khai Nguyen answer worked for me.

HelloWorld.csproj

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

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp6.0</TargetFramework>
    <ImplicitUsings>disable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>

</Project>

I changed the <TargetFramework>netcoreapp5.0</TargetFramework>

to

<TargetFramework>netcoreapp6.0</TargetFramework>

Since, 6.0 was already installed.

answered Jul 13, 2022 at 2:55

Aditya Rajgor's user avatar

  • Visual Studio 2022 v17.3.6
  • WSL with dotnet 6.0.1 (in Ubuntu) and 6.0.10 (on Windows)
  • testEnvironments.json

"Testhost process exited with error: It was not possible to find any compatible framework version"

I needed to enalbe the Remote Testing install option in the Test Options:

Remote Testing Option

answered Nov 8, 2022 at 14:14

Michael Blake's user avatar

Michael BlakeMichael Blake

1,9892 gold badges17 silver badges31 bronze badges

Alright, this is such BS! Why the H can’t Microsoft get a rollout right. Roll it out right or roll it back!

Anyways — here’s what I had to do to fix this garbage.

1: I had to uninstall all of the .net Core items in the «Programs» section of the control panel.
2: I went to https://github.com/dotnet/core/blob/master/release-notes/download-archive.md and got «2.0 sdk and 2.0 runtime» and installed that.
3: I ran my migration and got the same error as above but the version it was complaining about was «2.0» — SO, I added «2.0.0» to my project and the stupid thing worked.

I hope this works for any one of you — I worked hard enough on this project just to have a «Botched Rollout» reduce it to smoke!

Oh, and another thing — my «data» project borked because the file «.EntityFrameworkCore.targets» was not cleared before it was overwritten. I had 2 ending nodes at the bottom of the file. I hope they fix THAT too.

(Sorry all, I wasted WAY too much time on this SNAFU and it didn’t have to happen.)

Reading 0.68 minutes Count | 1092 characters
main content | 1. Introduction & Background 2, solution 3, declaration and reference
«.NET startup program error: IT WAS NOT POSSIBLE TO FIND ANY Compatible Framework Version»
editor | SCscHero Write time | 2021/12/18 PM11:37
Article type | Series Degree of completion | Completed
motto Every great career has a slight start.

I. Introduction & BackgroundCompletion: 100%

a) respond to problems

When you start the .NET program, you have encountered the following error:

It was not possible to find any compatible framework version 
The framework' Microsof t. AspNetCore. App,version' 2.2.0'' (x64) was not found.
The following frameworks were found:
2. 1.30 at [c: Program Files dotnet sharedMicrosof t. AspNetCore. App]
3. 1. 18 at [C: Program Files dotnet sharedMicrosoft. AspNetCore. App
5.0.9 at [C: Program Files dotnet shared Microsof t. AspNe tCore. App
6.0.0 rc.1.21452.15 at [C: Program Files dotnet sharedMi crosof t. 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=Microsof t. AspNetCore. App&framework version=2. 2. O&arch=x64&rid=win10-x64
C: Program Files dotnet dotnet. exe (process 8432) exited with code 2147450730.
To automatically close the console when debugging stops, enable Tools >0ptions- >Debugging >Automatically close the console when debugging stops.
Press any key to close this window...

b) Application scenario

  • It is common to use multiple .NET development framework versions in the project, such as use .Net core3.1, .Net core2.2, .net framework4.7, etc., multiple SDKs.
  • Frequently in multi-project multi-developed scenes launched scenes.

Second, the solutionCompletion: 100%

a) Step 1: Check if the development framework component is installed

Tools -> Get Tools and Features … -> Individual Component tab.

b) Step 2: Download SDK

If you still don’t work after step 1 installation, you need to download SDK separately. The link is:https://dotnet.microsoft.com/en-us/download。

At present, Microsoft pushes the unified version of .NET6, so some entrances may not be obvious, organized as follows:

  • .NET5 / 6 & .NET CORE Download Link:https://dotnet.microsoft.com/en-us/download/dotnet
  • .NET Framework SDK Download Link:https://dotnet.microsoft.com/en-us/download/dotnet-framework

Third, statement and referenceCompletion: 100%

Original blog post, do not reprint without permission.

Welcome to help, welcome you, collect, and pay attention. If you have any questions, please comment on your message! If you need to contact your blogger, you can directly blog private letter SCSChero.

Scenario & Error

Is Microsoft going to end support for the Web API developed using .Net Core 2.1by Aug 21? We planned to migrate it to .Net Core 3.1 and successfully migrated it. We were able to run the application in the local machine using Visual Studio IDE and manually package uploading in AWS Lambda, which  worked well. But the automation build & deployment are getting failed with the below error,

It was not possible to find any compatible framework version
The framework ‘Microsoft.NETCore.App’, version ‘2.1.0’ was not found.
The following frameworks were found:
3.1.15 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Fix applied

  1. .NET code does not contain any error. All migration code was done well.
  2. The root cause of the issue lies in the Circle CI configuration file (YAML).
  3. At step “Install Serverless CLI” build pipeline run the below command,

    dotnet tool install —global Amazon.Lambda.Tools —version 3.1

  4. The command installs the Tool ‘amazon.lambda.tools’ (version ‘3.1.0’)
  5. However, this version of Amazon.Lambda.Tools have a strong dependency on .NETCoreApp 2.1. see below screenshot

The framework'Microsoft.NETCore.App', version'2.1.0' was not found.

So, at a later step, when the command “dotnet lambda package —configuration release —framework netcoreapp3.1 —output-package bin/release/netcoreapp3.1/deploy-package.zip” is run, the AWS tool is unable to complete the command as it could not find the missing dependency of NETCoreApp 2.1.

As we are upgrading the code from .NET core 2.1 to .NET core 3.1, we cannot downgrade to NETCoreApp 2.1. Finally, after changing the command to “dotnet tool install —global Amazon.Lambda.Tools”, which makes sure the latest version (5.1.2) is installed. This version of the Amazon.Lambda.Tools package has no dependencies and deployment goes smooth fixing the problem.

The framework'Microsoft.NETCore.App', version'2.1.0' was not found.

Yaml File snap for ref

Before Fix

The framework'Microsoft.NETCore.App', version'2.1.0' was not found.

The framework'Microsoft.NETCore.App', version'2.1.0' was not found.

After Fix

The framework'Microsoft.NETCore.App', version'2.1.0' was not found.

У меня есть приложение ASP.Net Core MVC 2.2. Запуск приложения в Visual Studio работает нормально. Однако, когда я пытаюсь опубликовать приложение с помощью публикации в сети Dotnet , я получаю следующую ошибку:

It was not possible to find any compatible framework version
  The specified framework 'Microsoft.NETCore.App', version '1.0.0' was not found.
    - Check application dependencies and target a framework version installed at:
        C:Program Filesdotnet
    - Installing .NET Core prerequisites might help resolve this problem:
        https://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
    - The .NET Core framework and SDK can be installed from:
        https://aka.ms/dotnet-download
    - The following versions are installed:
        2.0.9 at [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
        2.1.5 at [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
        2.1.6 at [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
        2.1.7 at [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
        2.1.8 at [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
        2.1.9 at [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
        2.2.2 at [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
        2.2.3 at [C:Program FilesdotnetsharedMicrosoft.NETCore.App]

Я не понимаю, где может быть ссылка на V 1.0.0, вот вывод dotnet —info

.NET Core SDK (gem„á "global.json"):
 Version:   2.2.105
 Commit:    7cecb35b92

Laufzeitumgebung:
 OS Name:     Windows
 OS Version:  10.0.17763
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:Program Filesdotnetsdk2.2.105

Host (useful for support):
  Version: 2.2.3
  Commit:  6b8ad509b6

.NET Core SDKs installed:
  2.1.202 [C:Program Filesdotnetsdk]
  2.1.403 [C:Program Filesdotnetsdk]
  2.1.500 [C:Program Filesdotnetsdk]
  2.1.502 [C:Program Filesdotnetsdk]
  2.1.503 [C:Program Filesdotnetsdk]
  2.1.504 [C:Program Filesdotnetsdk]
  2.1.505 [C:Program Filesdotnetsdk]
  2.2.104 [C:Program Filesdotnetsdk]
  2.2.105 [C:Program Filesdotnetsdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.5 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.6 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.7 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.8 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.9 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.2 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.3 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.5 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.6 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.7 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.8 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.9 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.2 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.3 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
  Microsoft.NETCore.App 2.0.9 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
  Microsoft.NETCore.App 2.1.5 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
  Microsoft.NETCore.App 2.1.6 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
  Microsoft.NETCore.App 2.1.7 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
  Microsoft.NETCore.App 2.1.8 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
  Microsoft.NETCore.App 2.1.9 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
  Microsoft.NETCore.App 2.2.2 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
  Microsoft.NETCore.App 2.2.3 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]

Файл global.json не используется, файл * .csproj выглядит следующим образом:

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

  <PropertyGroup>
   <TargetFramework>netcoreapp2.2</TargetFramework>
    <AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
    <PreserveCompilationContext>true</PreserveCompilationContext>
    <AssemblyName>a17e.Web</AssemblyName>
    <OutputType>Exe</OutputType>
    <PackageId>a17e.Web</PackageId>
    <TypeScriptToolsVersion>3.1</TypeScriptToolsVersion>
    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
    <RestoreProjectStyle>PackageReference</RestoreProjectStyle>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='thi|AnyCPU'" />

  <ItemGroup>
    <None Include="App.config" />
    <None Update="log4net.config">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
    </None>
    <None Update="Views***;Areas***.cshtml">
      <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
    </None>
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..a17e.Applicationa17e.Application.csproj" />
    <ProjectReference Include="..a17e.EntityFrameworkCorea17e.EntityFrameworkCore.csproj" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Castle.LoggingFacility.MsLogging" Version="3.1.0" />
    <PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" />
    <PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="2.2.0" />
    <PackageReference Include="BundlerMinifier.Core" Version="2.9.406" />
    <PackageReference Include="Microsoft.IdentityModel.Tokens" Version="5.4.0" />
    <PackageReference Include="Abp.AspNetCore" Version="4.4.0" />
    <PackageReference Include="Abp.Castle.Log4Net" Version="4.4.0" />
    <PackageReference Include="Microsoft.AspNetCore.Authentication.Facebook" Version="2.2.0" />
    <PackageReference Include="Microsoft.AspNetCore.Authentication.Google" Version="2.2.2" />
    <PackageReference Include="Microsoft.AspNetCore.Authentication.MicrosoftAccount" Version="2.2.0" />
    <PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="2.2.0" />
    <PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="2.2.1" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
    <PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="2.2.1" />
    <PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.2.0" />
    <PackageReference Include="Microsoft.AspNetCore.Session" Version="2.2.0" />
    <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.2.3" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.Design" Version="1.1.6" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.2.3">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
    </PackageReference>
    <PackageReference Include="Microsoft.Extensions.Logging" Version="2.2.0" />
    <PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.2.0" />
    <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.3" />
    <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.2.0" />
    <PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.5.1" />
  </ItemGroup>

  <ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
    <Reference Include="System" />
    <Reference Include="Microsoft.CSharp" />
  </ItemGroup>

  <Target Name="PrepublishScript" BeforeTargets="PrepareForPublish">
    <Exec Command="dotnet bundle" />
  </Target>

  <ItemGroup>
    <DotNetCliToolReference Include="BundlerMinifier.Core" Version="2.2.301" />
  </ItemGroup>

  <ItemGroup>
    <Folder Include="logs" />
    <Folder Include="wwwrootcssviewsaccount" />
  </ItemGroup>

</Project>

2 ответа

Лучший ответ

Я думаю, что проблема исходит от вашего PrepublishScript (dotnet bundle). Пакет BundlerMinifier.Core (версия 2.9.406) имеет зависимости от:

  • .NETCoreApp1.0
  • .NETCoreApp2.0
  • .NETFramework4.5.2
  • .NETStandard2.0

Кажется, поскольку проект нацелен на netcoreapp2.2, эта ссылка не работает и либо фактически возвращается к netcoreapp1.0, либо просто вводит в заблуждение сообщение. Для проверки работоспособности, возможно, понизьте проект до netcoreapp2.0, чтобы проверить, работает он или нет.

Просто примечание, netcoreapp2.2 реализует netstandard2.0, поэтому я ожидаю, что это будет работать для всех, но возможно, что вывод не происходит во время разрешения зависимости.


2

Pete Garafano
26 Мар 2019 в 15:24

Решение состояло в том, что у меня была старая версия BundlerMinifier. Ссылка на ядро — изменение, которое решило проблему:

<DotNetCliToolReference Include="BundlerMinifier.Core" Version="2.9.406" />

Я также нашел описание ошибки: https://github.com/madskristensen/BundlerMinifier/issues/292


2

Tobias Schittkowski
26 Мар 2019 в 15:18

Solution 1

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

The documentation says:

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

Solution 2

Some months ago a Visual Studio update broke my capability of running tests. One of the issues was exactly this error. I have the x64 version of the SDK installed but VS tests runner was attempting to use the x86 version. The fix is just changing a setting inside the Test Explorer: Processor Architecture for AnyCPU Projects -> x64.

enter image description here

Solution 3

It seem to be a known issue for .Net Core installation, github.com/dotnet/core-setup/issues/4350

I have to uninstall all .Net Core packages, both x64 and x86, then reinstalled .Net Core x86 package. And that solved the problem.

Related videos on Youtube

Fix :  It was not possible to find any compatible framework version

04 : 09

Fix : It was not possible to find any compatible framework version

The specified framework 'Microsoft.NETCore.App', version '1.x.x' was not found. Visual Studio

02 : 27

The specified framework ‘Microsoft.NETCore.App’, version ‘1.x.x’ was not found. Visual Studio

Fix Net Framework v.4.0.30319 Error Windows 7 100%

02 : 57

Fix Net Framework v.4.0.30319 Error Windows 7 100%

how to fix dot net framework is already installed on this computer

01 : 50

how to fix dot net framework is already installed on this computer

Solucion error "The framework 'Microsoft.WindowsDesktop.App', version '5.0.0' was not found"

01 : 35

Solucion error «The framework ‘Microsoft.WindowsDesktop.App’, version ‘5.0.0’ was not found»

Fix: To Run This Application, You Must Install .NET Core

05 : 50

Fix: To Run This Application, You Must Install .NET Core

Khắc phục lỗi không cài được NET Framework trên máy tính

04 : 32

Khắc phục lỗi không cài được NET Framework trên máy tính

Tutorial for C#/.NET SDKs not installing (Fix) 2021 aka The application 'new' does not exist.

03 : 34

Tutorial for C#/.NET SDKs not installing (Fix) 2021 aka The application ‘new’ does not exist.

This application requires  NET Framework 2 0 Please install the  NET Framework #greenpolygames

01 : 58

This application requires NET Framework 2 0 Please install the NET Framework #greenpolygames

Sửa lỗi Installation Did Not Succees khi cài .NET Framework | Fix Installation Did Not Succees

11 : 41

Sửa lỗi Installation Did Not Succees khi cài .NET Framework | Fix Installation Did Not Succees

[SOLVED] How to fix “the specified version was not found” error in GNS3

05 : 52

[SOLVED] How to fix “the specified version was not found” error in GNS3

Comments

  • 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 FilesdotnetsharedMicrosoft.NETCore.App]
    2.0.9 at [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
    2.1.5 at [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
    

    The .Net Core 2.2(x86) SDK was installed under path «C:Program Files (x86)dotnetshared», 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>
    • That error message sounds pretty definitive. Just a thought, but why not try installing .NET Core 2.2 anyway?

    • What’s the output of dotnet --list-runtimes? Does it include Microsoft.NETCore.App 2.2.0?

    • @Robert Harvey♦ I installed .Net Core 2.2(x64), got different error «System.BadImageFormatException: Could not load file or assembly ‘xxxxx’. An attempt was made to load a program with an incorrect format.». My project’s platform target is x86, should execute the program under .Net Core 2.2(x86). I think the problem is system did not recognize that x86 .Net Core was installed.

    • Aha. Now we’re getting somewhere.

    • can you also share your .csproj? and which assembly is it complaining about?

    • @Jonathon Chase, it shows Microsoft.NETCore.App 2.2.0, which I just installed according to Robert Harvey♦ suggestion. But it did not show .Net Core 2.2(x86) version.

    • @Aman B post has been updated. Thanks. I am suspecting the project file too.

    • @wltz thanks, I’m suspecting some nuget packages need updating. Have you tried updating the installed nuget packages?

    • @All my nuget packages are up to date, except 1 third-party dll. I doubt that’s the issue. I find it’s weird in the csproj file, the TargetFramework section only mentioned netcoreapp2.2, how could this tell it’s based on Net Core x86 or x64!

    • Recently, after a windows update, I had to run such an install, and indeed afterwards everything worked again.

    • If you had any other .net version installed, maybe there is a leftover environment var DOTNET_ROOT specified, which makes your system look into the wrong path.

  • thanks for the response. I’ve add these two lines to the section <PropertyGroup Condition=»‘$(Configuration)|$(Platform)’==’Release|x86′»>, cause the platform target is x86. After rebuild and deploying, I still got the error «System.BadImageFormatException: Could not load file or assembly». .Net Core 2.2(x86) still not in my runtime list. I think I will get .Net Core x86 installed properly first.

  • it seem to be a known issue for .Net Core installation, github.com/dotnet/core-setup/issues/4350. I have to uninstall all .Net Core packages, both x64 and x86, then reinstalled .Net Core x86 package. And that solved the problem.

  • i’m using VSCode and when i switch to x86, it won’t let me debug.

  • @samyi I was using Visual Studio for this project. Maybe give Visual Studio a shot?

  • yes your answer did help me..thx a lot

  • this answer helped me when I was trying to use Oracle.EntityFrameworkCore !

  • Thanks. It did help!

  • Still relevant. Works with Postgresql on MacOS 12.2.1

  • It was on auto but didn’t worked for me, i had to manually select x86. Now it is working, thanks for this quick help.

  • Where is this button? I can’t find it on the UI

  • The dotnet --info command helped to understand the problem, and I just updated Visual Studio and the update also fixed the .Net 6 installation.

Recents

Related

Hello,

I have a few weeks old project that uses the new ASP.NET Core SignalR package delpoyed on Azure.

These SignalR packages don’t exist anymore. I decided to update them. When I wanted to deploy again my updated project on Azure I got the error «It was not possible to find any compatible framework version«.

It was working just fine before; I don’t know why I have this error.

The ASP.NET Core project targets «netcoreapp2.0″ (Sdk=»Microsoft.NET.Sdk.Web»).

Here is the old packages I replaced:

    <PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0-preview3-25939" />
    <PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="1.0.0-preview3-25939" />
    <PackageReference Include="Microsoft.AspNetCore.SignalR" Version="1.0.0-preview3-25939" />
    <PackageReference Include="Microsoft.AspNetCore.SignalR.Http" Version="1.0.0-preview3-25939" />
    <PackageReference Include="Microsoft.AspNetCore.Sockets.Client.Http" Version="1.0.0-preview3-25939" />

by these ones:

    <PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0-rtm-26423" />
    <PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="1.0.0-alpha1-26423" />
    <PackageReference Include="Microsoft.AspNetCore.SignalR" Version="1.0.0-alpha1-26423" />
    <PackageReference Include="Microsoft.AspNetCore.SignalR.Http" Version="1.0.0-alpha1-26423" />
    <PackageReference Include="Microsoft.AspNetCore.Sockets.Client.Http" Version="1.0.0-alpha1-26423" />

SingalR package: https://dotnet.myget.org/feed/aspnetcore-dev/package/nuget/Microsoft.AspNetCore.SignalR/1.0.0-alpha1-26423.

I use only the 26423 version (and not the latest of SignalR) because it’s still use the 2.0.0-rtm-* of AspNetCore packages.

I also tried the latest packages for AspnetCore.All and SignalR; it doesn’t work either on Azure.

But every things I tried works on my local machine.

Any help would be very welcome!

Thanks,

Adrien.

Возможно, вам также будет интересно:

  • It rained in evening исправить ошибки
  • It rained in evening где ошибка
  • It rained cats and dogs on friday где ошибка
  • It iz the next day now something ошибки
  • It is snowing in july где ошибка

  • Понравилась статья? Поделить с друзьями:
    0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии