c# - Error publishing to Azure after upgrade to netcoreapp2.1
问题描述
I upgraded my applications form net core 2 to 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:
Severity Code Description Project File Line Suppression State Error This version of Microsoft.AspNetCore.App is only compatible with the netcoreapp2.1 target framework. Please target netcoreapp2.1 or choose a version of Microsoft.AspNetCore.App compatible with netcoreapp2.0.
<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. 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:
<TargetFramework>netcoreapp2.0</TargetFramework>
Problem solved after editing it by hand to 2.1.
推荐阅读
- c++ - MSBuild 行为还不清楚?
- excel - 通过隐藏行的数字动态列表
- javascript - 我可以使用 Promise.all 顺序处理一组承诺吗?
- esxi - 为什么全新的 ESXI 安装只使用了我一半的 SSD 存储空间?
- pycharm - Pycharm Professional 没有远程 SSH 解释器选项
- java - 如何更新可用于 Java 中两个不同对象的方法
- reactjs - 将表单提交数据作为 props 传递给本地 JS 文件中定义的另一个函数
- python - 如何在不使用python中的排序函数的情况下对多个参数进行排序?
- f# - 如何从 F# 中的 Seq.map 中获取异步值
- python - PySimpleGUI 问题 | 将多个窗口连接在一起并且按钮无法正常工作