Azure Function 无法发布并出现 'PackageDependencyResolution.targets' 错误

标签 azure visual-studio-2017 azure-functions visual-studio-publish

不知道如何解决此问题,但当我尝试发布我的 Azure 函数之一时收到此错误。

仅供引用 - 我将项目设置为 .Net 4.6.2,以及具有依赖项的其他项目。该项目构建但未发布

我应该恢复所有 NuGet 包还是可以尝试其他方法!?

这是错误 -

C:\Program Files\dotnet\sdk\2.1.202\Sdks\Microsoft.NET.Sdk\build\Microsoft.PackageDependencyResolution.targets(167,5): error : Assets file 'C:\Users\chuckdawit\Source\Workspaces\YogaBandy2017\YogaBandy2017\Yogabandy2017.StripeWebhook\obj\project.assets.json' doesn't have a target for '.NETFramework,Version=v4.6.1'. Ensure that restore has run and that you have included 'net461' in the TargetFrameworks for your project. [C:\Users\chuckdawit\Source\Workspaces\YogaBandy2017\YogaBandy2017\Yogabandy2017.StripeWebhook\Yogabandy2017.StripeWebhook.csproj]

最佳答案

我建议尝试以下步骤:

  1. 尝试删除项目中的 bin 和 obj 文件夹并重新构建。
  2. 打开“发布”页面,然后打开“配置”对话框,然后重新保存。它可能只是对标签进行排序。
  3. 转至发布配置文件 (Properties/PublishProfiles/*.pubxml) 并检查 TargetFramework 是否已更新以反射(reflect)新框架。如果没有,请在此处手动更改或只需运行发布选项卡上的配置选项。

有一个关于类似问题的详细讨论here .

关于Azure Function 无法发布并出现 'PackageDependencyResolution.targets' 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52655408/

相关文章:

json - 我在使用arm模板部署存储帐户时遇到问题

reactjs - Azure 上的 React 应用程序中未填充 Process.Env

c++ - Visual Studio 2017 cMake 图 TableView

python - 我在 python 中使用 pyttsx3 时收到 "member not found"错误

azure - 在项目/解决方案中编写/组织 Azure 函数的最佳实践

Azure函数+ARM : merge app settings with current settings

Azure 函数触发器不适用于 cosmosdb 的不同资源 ID

azure - 将不属于目录中已验证域名的用户(成员)添加到 Azure Active Directory

c# - 如何验证 documentdb 存储过程 REST 调用

c++ - 为什么我会收到链接器错误,即使两个文件都在同一目录中?