简体   繁体   English

找不到指定的框架“Microsoft.AspNetCore.All”,版本“2.2.0”

[英]The specified framework 'Microsoft.AspNetCore.All', version '2.2.0' was not found

Dotnet --version says 2.2.402 Dotnet --version说 2.2.402

dotnet --info says dotnet --info

.NET Core SDK (reflecting any global.json):
 Version:   2.2.402
 Commit:    c7f2f96116

Runtime Environment:
 OS Name:     centos
 OS Version:  7
 OS Platform: Linux
 RID:         centos.7-x64
 Base Path:   /usr/share/dotnet/sdk/2.2.402/

Host (useful for support):
  Version: 2.2.8
  Commit:  b9aa1abc51

.NET Core SDKs installed:
  2.2.402 [/usr/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.NETCore.App 2.2.8 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

I'm trying to publish my app on linux server which is working quite fine on server till my last try to update the application on server using the below command.我正在尝试在 linux 服务器上发布我的应用程序,该服务器在服务器上运行良好,直到我最后一次尝试使用以下命令更新服务器上的应用程序。

dotnet publish -c release -o ${API_PUBLISH_DIR}

the build process is throwing the following error构建过程引发以下错误

It was not possible to find any compatible framework version The specified framework 'Microsoft.AspNetCore.All', version '2.2.0' was not found.找不到任何兼容的框架版本找不到指定的框架“Microsoft.AspNetCore.All”,版本“2.2.0”。 - Check application dependencies and target a framework version installed at: /usr/share/dotnet/ - 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 - 检查应用程序依赖项并定位安装在以下位置的框架版本:/usr/share/dotnet/ - 安装 .NET 核心先决条件可能有助于解决此问题: https://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409 - The .NET 核心框架和 SDK 可以从以下位置安装: https://aka.ms/dotnet-download

more error details is.更多错误细节是。

/usr/share/dotnet/sdk/NuGetFallbackFolder/microsoft.aspnetcore.mvc.razor.viewcompilation/2.2.0/build/netstandard2.0/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.targets(64,5): error MSB3073: The command ""/usr/share/dotnet/dotnet" exec --runtimeconfig "/home/vng-dev/vng-web/vast-webapplication/vast_webapplication/WebAPI/bin/Release/netcoreapp2.2/WebAPI.runtimeconfig.json" --depsfile "/home/vng-dev/vng-web/vast-webapplication/vast_webapplication/WebAPI/bin/Release/netcoreapp2.2/WebAPI.deps.json" "/usr/share/dotnet/sdk/NuGetFallbackFolder/microsoft.aspnetcore.mvc.razor.viewcompilation/2.2.0/build/netstandard2.0/netcoreapp2.0/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.dll" @"obj/Release/netcoreapp2.2/microsoft.aspnetcore.mvc.razor.viewcompilation.rsp"" exited with code 150. [/home/vng-dev/vng-web/vast-webapplication/vast_webapplication/WebA /usr/share/dotnet/sdk/NuGetFallbackFolder/microsoft.aspnetcore.mvc.razor.viewcompilation/2.2.0/build/netstandard2.0/Microsoft.AspNetCore.Mvc.ZE405C1DF83BD248A07FC9A9132739AED6Z.ViewCompilation : 命令 ""/usr/share/dotnet/dotnet" exec --runtimeconfig "/home/vng-dev/vng-web/vast-webapplication/vast_webapplication/WebAPI/bin/Release/netcoreapp2.2/WebAPI.runtimeconfig。 json" --depsfile "/home/vng-dev/vng-web/vast-webapplication/vast_webapplication/WebAPI/bin/Release/netcoreapp2.2/WebAPI.deps.json" "/usr/share/dotnet/sdk/NuGetFallbackFolder /microsoft.aspnetcore.mvc.razor.viewcompilation/2.2.0/build/netstandard2.0/netcoreapp2.0/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.dll.22"@"obj/microsoft.aspnetcore/netcoreapp .mvc.razor.viewcompilation.rsp"" 退出,代码为 150。 [/home/vng-dev/vng-web/vast-webapplication/vast_webapplication/WebA PI/WebAPI.csproj] PI/WebAPI.csproj]

I didn't mentioned the version in.csproj file for AspNetCore.All and it's like this我没有提到 AspNetCore.All 的 in.csproj 文件中的版本,它是这样的

<PackageReference Include="Microsoft.AspNetCore.All" />

also tried replacing AspNetCore.All with AspNetCore.App like below还尝试用AspNetCore.All替换AspNetCore.App ,如下所示

<PackageReference Include="Microsoft.AspNetCore.App" />

this also doesn't help这也无济于事

I also tried with installing AspNetCore.MVC.Razor.ViewCompilation package but it doesn't help我也尝试安装 AspNetCore.MVC.Razor.ViewCompilation package 但它没有帮助

EDIT:编辑:

  1. Also tried updating the versions of both Microsoft.AspNetCore.App and Microsoft.AspNetCore.All one at a time.还尝试一次更新 Microsoft.AspNetCore.App 和 Microsoft.AspNetCore.All 的版本。
  2. tried compiling the app with versions attribute and without versions attribute.尝试使用版本属性和不版本属性编译应用程序。
  3. Tried updating all the project (.csproj) files in the solution.尝试更新解决方案中的所有项目 (.csproj) 文件。

For me it turns out issue in the build command对我来说,构建命令中的问题

I'm using this command -> dotnet publish -c release -o ${API_PUBLISH_DIR}我正在使用这个命令-> dotnet publish -c release -o ${API_PUBLISH_DIR}

changed this and add the platform on which I'm building it更改了这个并添加了我正在构建它的平台

dotnet publish -c release -r linux-x64 -o ${API_PUBLISH_DIR}

The recent automatic updates to .net core messes up something and couldn't figure out where are the version dependencies.最近对 .net 核心的自动更新搞砸了一些东西,无法弄清楚版本依赖关系在哪里。

Your project has a reference of Microsoft.AspNetCore.All similar to what given below.您的项目有一个 Microsoft.AspNetCore.All 的参考,类似于下面给出的。 But you have installed dotnet core 2.2.x, after dotnet core 2.0 Microsoft.AspNetCore.All is being removed.但是在删除 dotnet core 2.0 Microsoft.AspNetCore.All之后,您已经安装了 dotnet core 2.2.x。 Microsoft.NETCore.App is much lighter version similar to that package. Microsoft.NETCore.App 是更轻量级的版本,类似于 package。

I would suggest installing dotnet core 2.0.我建议安装 dotnet core 2.0。 In that case, you dont need to change your project.在这种情况下,您不需要更改您的项目。

<PackageReference Include="Microsoft.AspNetCore.All"/>
  • Add dotnet core 2.0 version in your Project在您的项目中添加 dotnet core 2.0 版本

< PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.6"/> < PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.6"/>

  • Also Add In property group同时添加属性组
<PropertyGroup> <PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest> </PropertyGroup>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 找不到指定的框架&#39;Microsoft.AspNetCore.All&#39;,版本&#39;2.1.2&#39; - The specified framework 'Microsoft.AspNetCore.All', version '2.1.2' was not found 部署ASP.NET Core 2.1.2容器结果在“指定的框架&#39;Microsoft.AspNetCore.All&#39;中,找不到版本&#39;2.1.2&#39;。” - Deploying ASP.NET Core 2.1.2 Container Result In “The specified framework 'Microsoft.AspNetCore.All', version '2.1.2' was not found.” 找不到任何兼容的框架版本找不到指定的框架&#39;Microsoft.AspNetCore.App&#39;版本&#39;2.2.0&#39; - It was not possible to find any compatible framework version The specified framework 'Microsoft.AspNetCore.App', version '2.2.0' was not found 此版本的 Microsoft.AspNetCore.All 仅兼容 netcoreapp2.1 目标框架 - This version of Microsoft.AspNetCore.All is only compatible with the netcoreapp2.1 target framework 构建成功但发布失败 - 此版本的 Microsoft.AspNetCore.All 仅与 netcoreapp2.2 目标框架兼容 - Build is success but publish fails - This version of Microsoft.AspNetCore.All is only compatible with the netcoreapp2.2 target framework 如何获取具有所有依赖项的Microsoft.AspNetCore.All(2.0版)源代码 - How to get Microsoft.AspNetCore.All (version 2.0) source codes with all dependencies 找不到任何兼容的框架版本。 找不到指定的框架“Microsoft.NETCore.App”,版本“2.2.0” - It was not possible to find any compatible framework version. The specified framework 'Microsoft.NETCore.App', version '2.2.0' was not found NETSDK1061:使用Microsoft.AspNetCore.All版本2.0.5还原了该项目,但在当前设置下,将使用版本2.0.4代替 - NETSDK1061: The project was restored using Microsoft.AspNetCore.All version 2.0.5, but with current settings, version 2.0.4 would be used instead 在Visual Studio 7.5 Mac中找不到指定的框架&#39;Microsoft.AspNetCore.App&#39;版本&#39;2.1.0&#39; - The specified framework 'Microsoft.AspNetCore.App', version '2.1.0' was not found docker in visual studio 7.5 mac 修复指定的框架&#39;Microsoft.AspNetCore.App&#39;版本&#39;2.1.1&#39; - Fixing The specified framework 'Microsoft.AspNetCore.App', version '2.1.1'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM