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

背景

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 编译成功,发布失败之解决

上一篇:测试build出来的dist文件夹是否编译成功


下一篇:javascript parseJSON