[英]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:编辑:
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"/>
< PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.6"/> < PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.6"/>
<PropertyGroup> <PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest> </PropertyGroup>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.