第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

在 Azure Functions 上使用 AdWords API

在 Azure Functions 上使用 AdWords API

C#
慕妹3242003 2021-08-29 17:49:53
我正在嘗試制作一個(gè)使用 AdWords API 的 Azure 函數(shù)。我的代碼工作正常,我所要做的就是讓函數(shù)以給定的時(shí)間間隔運(yùn)行。但是,當(dāng)我嘗試在本地運(yùn)行該函數(shù)時(shí),我收到以下錯(cuò)誤消息:[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)如果我嘗試上傳函數(shù)并運(yùn)行它,我會(huì)收到此錯(cuò)誤: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。我該怎么做才能修復(fù)此錯(cuò)誤并使我的函數(shù)運(yùn)行?更新:在 Jerry Liu 的幫助下解決問題后,出現(xiàn)以下錯(cuò)誤: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)
查看完整描述

2 回答

?
寶慕林4294392

TA貢獻(xiàn)2021條經(jīng)驗(yàn) 獲得超8個(gè)贊

問題現(xiàn)在在這里跟蹤。運(yùn)行時(shí)文件夾[FunctionProject]\bin\Debug\netcoreapp2.1\bin\runtimes中的程序集不會(huì)加載到函數(shù)上下文中。


在@Adrian 的幫助下,事實(shí)證明問題WinHttpHandler is only supported on .NET Framework and .NET Core runtimes on Windows是由于%USERPROFILE%\.nuget\packages\system.net.http.winhttphandler\4.4.0\lib\netstandard2.0在我們需要運(yùn)行時(shí)程序集時(shí)從 lib 復(fù)制的錯(cuò)誤程序集所致。


解決方法是將這些運(yùn)行時(shí)程序集復(fù)制到bin文件夾以使其由函數(shù)宿主加載。后Google.AdWords安裝24.1.0,右鍵單擊項(xiàng)目,Edit <FunctionProjectName>.csproj添加復(fù)制操作。有了 nuget 包的完整路徑,我們不必先將程序集復(fù)制到我們的項(xiàng)目中。


請(qǐng)注意,一旦我們安裝了新版本的軟件包,這些路徑可能會(huì)改變。


  <!-- For publish -->

  <ItemGroup>

    <None Include="$(USERPROFILE)\.nuget\packages\system.private.servicemodel\4.4.2\runtimes\win7\lib\netstandard2.0\System.Private.ServiceModel.dll">

      <CopyToOutputDirectory>Always</CopyToOutputDirectory>

    </None>

    <None Include="$(USERPROFILE)\.nuget\packages\system.net.http.winhttphandler\4.4.0\runtimes\win\lib\netstandard2.0\System.Net.Http.WinHttpHandler.dll">

      <CopyToOutputDirectory>Always</CopyToOutputDirectory>

    </None>

  </ItemGroup>

  <!-- For local debug -->

  <Target Name="CopyRuntime" BeforeTargets="Build">

    <Copy SourceFiles="$(USERPROFILE)\.nuget\packages\system.net.http.winhttphandler\4.4.0\runtimes\win\lib\netstandard2.0\System.Net.Http.WinHttpHandler.dll" DestinationFolder="$(OutputPath)\bin" />

    <Copy SourceFiles="$(USERPROFILE)\.nuget\packages\system.private.servicemodel\4.4.2\runtimes\win7\lib\netstandard2.0\System.Private.ServiceModel.dll" DestinationFolder="$(OutputPath)\bin" />

  </Target>


查看完整回答
反對(duì) 回復(fù) 2021-08-29
?
慕俠2389804

TA貢獻(xiàn)1719條經(jīng)驗(yàn) 獲得超6個(gè)贊

Jerry 描述的相同解決方法將適用于該WinHttpHandler問題。我的 Azure Functions v2 項(xiàng)目文件中有以下內(nèi)容:


<ItemGroup>

  <None Update="System.Private.ServiceModel.dll">

    <CopyToOutputDirectory>Always</CopyToOutputDirectory>

  </None>

  <None Update="System.Net.Http.WinHttpHandler.dll">

    <CopyToOutputDirectory>Always</CopyToOutputDirectory>

  </None>

</ItemGroup>

<Target Name="CopySPSM" BeforeTargets="Build">

  <Copy SourceFiles="System.Private.ServiceModel.dll" DestinationFolder="$(OutputPath)\bin" />

  <Copy SourceFiles="System.Net.Http.WinHttpHandler.dll" DestinationFolder="$(OutputPath)\bin" />

</Target>

FWIW,WinHttpHandler似乎只有在您嘗試向 Google Ads API 發(fā)出服務(wù)請(qǐng)求時(shí)才需要添加 - 報(bào)告請(qǐng)求和響應(yīng)沒有它就可以正常工作。


查看完整回答
反對(duì) 回復(fù) 2021-08-29
  • 2 回答
  • 0 關(guān)注
  • 234 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)