将.NET Core 2.0 Web应用程序发布到Azure App Service时出错 [英] Error publishing .NET Core 2.0 web application to Azure App Service

查看:108
本文介绍了将.NET Core 2.0 Web应用程序发布到Azure App Service时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近将Visual Studio 2017社区版从15.6.2版本升级到了15.6.3,自那时以来,我无法使用现有的发布配置文件将.NET Core 2.0 Web应用程序成功部署到Azure应用服务.

I recently upgraded my Visual Studio 2017 Community Edition from version 15.6.2 to 15.6.3 and since then I have not been able to successfully deploy my .NET Core 2.0 web application to my Azure App Services using an existing Publishing Profile.

错误消息是'C:\ Program Files \ dotnet \ sdk \ 2.1.102 \ Sdks \ Microsoft.NET.Sdk \ build \ Microsoft.PackageDependencyResolution.targets(167,5):错误:资产文件'\ project .assets.json'没有针对.NETCoreApp,Version = v2.0'的目标.确保还原已运行,并且已在项目的TargetFrameworks中包含"netcoreapp2.0".

The error messages is 'C:\Program Files\dotnet\sdk\2.1.102\Sdks\Microsoft.NET.Sdk\build\Microsoft.PackageDependencyResolution.targets(167,5): Error : Assets file '\project.assets.json' doesn't have a target for '.NETCoreApp,Version=v2.0'. Ensure that restore has run and that you have included 'netcoreapp2.0' in the TargetFrameworks for your project.'

我尝试过:

  • 重新下载新的程序包配置文件,然后重新构建和发布.
  • 从\ obj \文件夹中删除project.assets.json文件,重建发布.
  • 将.NET Core 2.0中的项目属性中的目标框架更改为另一个框架,然后再次进行重新构建和发布.

以上都不是成功部署的结果,而且我一直收到相同的错误消息.

None of the above resulted in a successful deployment and I kept getting the same error message.

我还检查了project.assets.json文件,目标是".NETCoreApp,Version = v2.0".

I also examined the project.assets.json file and the target is ".NETCoreApp,Version=v2.0".

我运行了"dotnet恢复","dotnet构建"和"dotnet部署",所有这些都成功了.

I ran 'dotnet restore', 'dotnet build' and 'dotnet deploy', all of which succeeded.

推荐答案

发布和本地版本存在相同的问题.

I had the same problem with the publishing and a local build.

开发者社区对此进行了讨论 https://developercommunity.visualstudio.com/content/problem/218674/assets-file-cxxxxxxobjprojectassetsjson-doesnt-hav.html

The developer community has a discussion about this https://developercommunity.visualstudio.com/content/problem/218674/assets-file-cxxxxxxobjprojectassetsjson-doesnt-hav.html

Resharper和MS人员发现了问题,并承诺会尽快解决...

Resharper and MS people found the problem and promised to fix it soon...

目前,删除sdk \ 2.1.102并重新启动解决了我的问题

For now, deletion of the sdk\2.1.102 and the restart solved my problems

这篇关于将.NET Core 2.0 Web应用程序发布到Azure App Service时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆