简体   繁体   English

升级到 netcoreapp2.1 后发布到 Azure 时出错

[英]Error publishing to Azure after upgrade to netcoreapp2.1

I upgraded my applications form net core 2 to net core 2.1.我将我的应用程序从 net core 2 升级到 net core 2.1。 I followed microsoft's upgrade instructions and locally all works fine.我按照微软的升级说明在本地一切正常。 However when i try to publish a dot net core web app with visual studio i get the message bellow like the upgrade did not happen at all:但是,当我尝试使用 Visual Studio 发布 dot net core web 应用程序时,我收到以下消息,就像根本没有发生升级一样:

Severity Code Description Project File Line Suppression State Error This version of Microsoft.AspNetCore.App is only compatible with the netcoreapp2.1 target framework.严重性代码说明项目文件行抑制状态错误此版本的 Microsoft.AspNetCore.App 仅与 netcoreapp2.1 目标框架兼容。 Please target netcoreapp2.1 or choose a version of Microsoft.AspNetCore.App compatible with netcoreapp2.0.请针对 netcoreapp2.1 或选择与 netcoreapp2.0 兼容的 Microsoft.AspNetCore.App 版本。

<PropertyGroup>
  <TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>

........... …………

 <ItemGroup>
   <PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.1" />
</ItemGroup>

I know that i am not supposed to have a version in Microsoft.AspNetCore.App but visual studio 2017 (v15.7.3) does not recognize the referenced libraries otherwise.我知道我不应该在 Microsoft.AspNetCore.App 中有一个版本,但 Visual Studio 2017 (v15.7.3) 否则无法识别引用的库。 However this should not be a problem for publishing.但是,这对于发布来说应该不是问题。

Any help would be appreciated.任何帮助,将不胜感激。

Seems that in .pubxml file the targetframework is set also and since I created the publish file with version 2.0 it never updated the xml:似乎在 .pubxml 文件中也设置了目标框架,并且由于我使用 2.0 版创建了发布文件,因此它从未更新过 xml:

<TargetFramework>netcoreapp2.0</TargetFramework>

Problem solved after editing it by hand to 2.1.手动编辑到 2.1 后问题解决。

暂无
暂无

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

相关问题 NetCoreApp2.1 System.Data参考错误 - NetCoreApp2.1 System.Data reference error UWP项目与netcoreapp2.1不兼容 - UWP project not compatible with netcoreapp2.1 如何在 Azure 函数 .Net 项目中获取 bin/debug/netcoreapp2.1 路径? - How to get bin/debug/netcoreapp2.1 path in Azure function .Net project? 软件包Microsoft.CSharp 4.5.0与netcoreapp2.1不兼容错误消息 - Package Microsoft.CSharp 4.5.0 not compatible with netcoreapp2.1 Error Message bin \\ Debug \\ netcoreapp2.1 \\ bin不存在 - bin\Debug\netcoreapp2.1\bin does not exist netcoreapp2.1中的Console.BufferHeight在Ubuntu中引发Exception PlatformNotSupportedException - Console.BufferHeight in netcoreapp2.1 raise Exception PlatformNotSupportedException in Ubuntu 为什么 netcoreapp2.1 和 netcoreapp3.1 的 TimeSpan 值不同? - Why are the TimeSpan values different between netcoreapp2.1 and netcoreapp3.1? 为什么 Visual Studio 告诉我 netstandard2.1 与 netcoreapp2.1 不兼容? - Why is Visual Studio telling me that netstandard2.1 is incompatible with netcoreapp2.1? 此版本的 Microsoft.AspNetCore.All 仅兼容 netcoreapp2.1 目标框架 - This version of Microsoft.AspNetCore.All is only compatible with the netcoreapp2.1 target framework 项目“ClassLibrary1.csproj”针对“netcoreapp2.1”。 它不能被以“.NETFramework,Version=v4.7.2”为目标的项目引用 - Project 'ClassLibrary1.csproj' targets 'netcoreapp2.1'. It cannot be referenced by a project that targets '.NETFramework,Version=v4.7.2'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM