背景

Asp.Net Core 项目编译成功,发布失败。

错误

Assets file 'D:\……\obj\project.assets.json' doesn't have a target for '.NETCoreApp,Version=v1.1'. Ensure that restore has run and that you have included 'netcoreapp1.1' in the TargetFrameworks for your project.

[.Net Core] - Asp.Net Core 编译成功,发布失败之解决

分析

该项目为 .Net Core 2.0 框架,与发布配置文件中版本号不一致。

[.Net Core] - Asp.Net Core 编译成功,发布失败之解决

解决

打开 ~\Properties\PublishProfiles\CustomProfile.pubxml,修正 TargetFramework 版本号即可。

[.Net Core] - Asp.Net Core 编译成功,发布失败之解决

[.Net Core] - Asp.Net Core 编译成功,发布失败之解决

相关文章:

  • 2021-05-15
  • 2021-06-25
  • 2022-02-25
  • 2022-01-11
  • 2021-08-25
猜你喜欢
  • 2021-10-21
  • 2022-12-23
  • 2022-12-23
  • 2021-11-04
  • 2021-09-20
  • 2022-12-23
  • 2021-12-06
相关资源
相似解决方案