[英]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.