本文介绍了使用移动广告引发的例外情况的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Microsoft移动广告SDK(2010年9月16日发布),我在模拟器中运行的WP7应用程序中使用了此XAML:


  < ; Microsoft_Advertising_Mobile_UI:AdControl x:Name =" AdControl" d:LayoutOverrides = QUOT;身高" Grid.Row = QUOT; 2英寸VerticalAlignment = QUOT;底座" AdUnitId =" 22465" AdModel = QUOT;语境"的applicationID = QUOT; MostPopular" AdSelectionKeywords =" WINDOWS PHONE 7,MICROSOFT" />

广告在显示广告单元时出现此错误:


Microsoft.Advertising.Mobile。发生了UI.AdClientException

 消息=响应处理期间发生意外错误(名称:ECN)。

  StackTrace:

      在Microsoft.Advertising.Mobile.Advertisement.CreateAdvertisement(String jsonResponse,AdDownloadCompleteCallback adDownloadCompleteCallback)

      在Microsoft.Advertising.Mobile.AdPlacement.WebRequestComplete(WebRequestWrapper请求)

      在Microsoft.Advertising.Mobile.WebRequestWrapper.NotifyResults()

      在Microsoft.Advertising.Mobile.WebRequestWrapper.ProcessCurrentRequestComplete()

      在Microsoft.Advertising.Mobile.WebRequestWrapper.ReadCallback(IAsyncResult结果)

       at System.IO.Stream.BeginRead(Byte [] buffer,Int32 offset,Int32 count,AsyncCallback callback,Object state)

      在Microsoft.Advertising.Mobile.WebRequestWrapper.ReadCallback(IAsyncResult结果)

       at System.IO.Stream.BeginRead(Byte [] buffer,Int32 offset,Int32 count,AsyncCallback callback,Object state)

      在Microsoft.Advertising.Mobile.WebRequestWrapper.WebRespCallback(IAsyncResult result)

      在System.Net.Browser.ClientHttpWebRequest。<> c__DisplayClassa。< InvokeGetResponseCallback> b__8(对象state2)

       at System.Threading.ThreadPool.WorkItem.doWork(Object o)

      在System.Threading.Timer.ring()


Michael S. Scherotter Media Experience Evangelist Microsoft Corporation http://blogs.msdn.com/synergist http://twitter.com/增效剂http://facebook.com/synergist

解决方案

Using the Microsoft Mobile Advertising SDK (Released 9/16/2010), I have this XAML in a WP7 App running in the emulator:

  <Microsoft_Advertising_Mobile_UI:AdControl x:Name="AdControl" d:LayoutOverrides="Height" Grid.Row="2" VerticalAlignment="Bottom" AdUnitId="22465 " AdModel="Contextual" ApplicationId="MostPopular" AdSelectionKeywords="WINDOWS PHONE 7,MICROSOFT"/>
Ad I get this error when the ad unit is displayed:

Microsoft.Advertising.Mobile.UI.AdClientException occurred
  Message=An unexpected error occurred during response processing (Name: ECN).
  StackTrace:
       at Microsoft.Advertising.Mobile.Advertisement.CreateAdvertisement(String jsonResponse, AdDownloadCompleteCallback adDownloadCompleteCallback)
       at Microsoft.Advertising.Mobile.AdPlacement.WebRequestComplete(WebRequestWrapper request)
       at Microsoft.Advertising.Mobile.WebRequestWrapper.NotifyResults()
       at Microsoft.Advertising.Mobile.WebRequestWrapper.ProcessCurrentRequestComplete()
       at Microsoft.Advertising.Mobile.WebRequestWrapper.ReadCallback(IAsyncResult result)
       at System.IO.Stream.BeginRead(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state)
       at Microsoft.Advertising.Mobile.WebRequestWrapper.ReadCallback(IAsyncResult result)
       at System.IO.Stream.BeginRead(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state)
       at Microsoft.Advertising.Mobile.WebRequestWrapper.WebRespCallback(IAsyncResult result)
       at System.Net.Browser.ClientHttpWebRequest.<>c__DisplayClassa.<InvokeGetResponseCallback>b__8(Object state2)
       at System.Threading.ThreadPool.WorkItem.doWork(Object o)
       at System.Threading.Timer.ring()


Michael S. Scherotter Media Experience Evangelist Microsoft Corporation http://blogs.msdn.com/synergist http://twitter.com/synergist http://facebook.com/synergist

解决方案


这篇关于使用移动广告引发的例外情况的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 12:26