我正在尝试制作一个使用 AdWords API 的 Azure 函数。我的代码工作正常,我所要做的就是让函数以给定的时间间隔运行。但是,当我尝试在本地运行该函数时,我收到以下错误消息:
[22-Jun-18 19:08:58] Executed 'KeywordPlanner' (Failed, Id=ab7c3ecf-1238-4370-ab5b-17d547d354b3)
[22-Jun-18 19:08:58] System.Private.CoreLib: Exception while executing function: KeywordPlanner. System.Configuration.ConfigurationManager: Configuration system failed to initialize. System.Configuration.ConfigurationManager: Unrecognized configuration section system.serviceModel. (C:\Users\frede\AppData\Local\Azure.Functions.V2.Cli\func.dll.config line 204)
如果我尝试上传函数并运行它,我会收到此错误:
2018-06-22T18:50:35 Welcome, you are now connected to log-streaming service.
2018-06-22T18:50:40.967 [Information] Executing 'KeywordPlanner' (Reason='This function was programmatically called via the host APIs.', Id=321756f7-3cf1-4235-a741-daf97d304058)
2018-06-22T18:50:40.972 [Error] System.Private.CoreLib: Exception while executing function: KeywordPlanner. Google.AdWords: Could not load file or assembly 'System.Private.ServiceModel, Version=4.1.2.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. System.Private.CoreLib: Could not load the specified file.
2018-06-22T18:50:41.039 [Error] Executed 'KeywordPlanner' (Failed, Id=321756f7-3cf1-4235-a741-daf97d304058)
我正在使用 .NET Standard 2.0。
我该怎么做才能修复此错误并使我的函数运行?
更新:
在 Jerry Liu 的帮助下解决问题后,出现以下错误:
2018-06-25T07:43:20.517 [Error] System.Private.CoreLib: Exception while executing function: KeywordPlanner. System.Net.Http.WinHttpHandler: WinHttpHandler is only supported on .NET Framework and .NET Core runtimes on Windows. It is not supported for Windows Store Applications (UWP) or Unix platforms.
2018-06-25T07:43:20.679 [Error] Executed 'KeywordPlanner' (Failed, Id=4231f32f-f83f-4f37-99a7-b90484933e2f)
宝慕林4294392
慕侠2389804
相关分类