背景
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 2.0 框架,与发布配置文件中版本号不一致。
解决
打开 ~\Properties\PublishProfiles\CustomProfile.pubxml,修正 TargetFramework 版本号即可。